Infolist RepeatableEntry not working properly

I have Many2Many relationship between Teacher and Section and a Student BelongsTo a Section. in the TeacherResource ViewPage(infolist), i am using a RepeatableEntry to display the Sections a Teacher belongs and in that RepeatableEntry i'm nesting another RepeatableEntry which has an Infolists\Components\Section Layout wrapper that will display the Students in the same Section as the Teacher. The students in Section A are being repeated in Section B and all the other sections .
3 Replies
Hussain4real
Hussain4realOP13mo ago
RepeatableEntry::make('sections')
->schema([
TextEntry::make('grade.name'),
TextEntry::make('name'),
TextEntry::make('description')
->limit(50),
TextEntry::make('capacity'),
TextEntry::make('status')
->badge(),
TextEntry::make('pivot.role')
->label(__('Role'))
->badge()
->color(function ($record) {
if ($record->pivot->role == 'home room') {
return Color::Emerald;
}

return Color::Amber;
}),
Infolists\Components\Section::make('Students info')
->schema([

RepeatableEntry::make('students')
->columnSpanFull()
->label(__('Students'))
->schema([
TextEntry::make('admission_number')
->label(__('Admission No')),
TextEntry::make('user.full_name')
->label(__('Name')),
])
RepeatableEntry::make('sections')
->schema([
TextEntry::make('grade.name'),
TextEntry::make('name'),
TextEntry::make('description')
->limit(50),
TextEntry::make('capacity'),
TextEntry::make('status')
->badge(),
TextEntry::make('pivot.role')
->label(__('Role'))
->badge()
->color(function ($record) {
if ($record->pivot->role == 'home room') {
return Color::Emerald;
}

return Color::Amber;
}),
Infolists\Components\Section::make('Students info')
->schema([

RepeatableEntry::make('students')
->columnSpanFull()
->label(__('Students'))
->schema([
TextEntry::make('admission_number')
->label(__('Admission No')),
TextEntry::make('user.full_name')
->label(__('Name')),
])
Hussain4real
Hussain4realOP13mo ago
for referrence
No description
Hussain4real
Hussain4realOP13mo ago
outcome
No description
Want results from more Discord servers?
Add your server