-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Package
filament/filament
Package Version
4.1.6
Laravel Version
12.33
Livewire Version
3.6.4
PHP Version
8.3
Problem description
When adding a Select input with relationship() method (many to many) inside a repeater, instead of eager loading all the items' filament retrieves the relationships one by one. the result is n+1 problem. Below i am attaching a screenshot from the laravel debugbar in a simple filament form.
For the context, i have created a sample project using 3 models. Project, Task, and User.
I added a repeater within the project resource which has 2 fields. The task name, and the Select element which relates to the many to many task-user relationship.

Expected behavior
It should eager load the many to many relationship between Task and User models.
Steps to reproduce
download the project. run composer install, copy .env.example to .env, run php artisan key:generate, run php artisan db:seed, run php artisan make:filament-user and enter the user credentials. open the /admin/projects user. click a project and open laravel debugbar panel.
Reproduction repository (issue will be closed if this is not valid)
https://github.com/GeorgeFourkas/filament_repeater_issue
Relevant log output
Metadata
Metadata
Assignees
Labels
Type
Projects
Status