marcf
Nested Repeater
Is it possible to have nested repeaters but specify the relationship of the nested one to be on the parent model?
I have three tables: evenement, film, and seance, along with their respective pivot tables and models. I'm following the documentation for integrating with a BelongsToMany relationship from the Filament PHP Repeater Documentation.
Here is my code:
In this setup, the nested repeater evenementSeances defaults to the pivot model (EvenementFilm) instead of the parent model (Evenement). If I uncomment the model specification (->model(Evenement::class)), the relationship does not save correctly.
My goal is for the user to first choose a film, and then, if they want, choose sessions for each selected film. How can I correctly specify the relationship for the nested repeater to be on the parent model?
Regards
7 replies