I May be Wrong but this sounds like you would like a BelongsTo/HasOne relationship? a
$student->belongsTo->group
https://laravel.com/docs/9.x/eloquent-relationships#updating-belongs-to-relationships
May 6, 2022
4
Level 1
Dynamic way to assign person to the table
I need to assign student to the group, even if there are 10 groups, one student can only be assign to one group, so no duplication. Also, once student is selected, there must be group name assigned to his name in 'Students' list. All this happening in one view. Groups are generated through nested loop with variables from another view.
I've been struggling with this for couple of days and can't find an easy solution. Any help is appreciated!
Please or to participate in this conversation.