fredricretzko
Attach auth()->user() to BelongsToMany model
Hi - I've been coding in php for 10+ years, three years in Laravel, two in Livewire and just getting into Filament.
I've set up a new PanelBuilder (School) which my users (Teacher) will use to update their record. Teacher and School have a BelongsToMany relationship.
I need help understading how to automatically attach the auth()->id() to the school_teacher model when the Teacher adds a school through the CreateSchool form as it doesn't make sense to have the teacher add themselves via the EditSchool form after they've created the school. Your help in explaining or pointing me to the right documentation is appreciated!
I've set up a new PanelBuilder (School) which my users (Teacher) will use to update their record. Teacher and School have a BelongsToMany relationship.
I need help understading how to automatically attach the auth()->id() to the school_teacher model when the Teacher adds a school through the CreateSchool form as it doesn't make sense to have the teacher add themselves via the EditSchool form after they've created the school. Your help in explaining or pointing me to the right documentation is appreciated!
10 replies