filament/forms
v3.2.121
v11.9
No response
PHP 8.3
I have a model with a BelongsToMany
relationship. It has a standard Filament resource with pages.
The form of this resources includes a Select
field where multiple records can be selected for a BelongsToMany
relationship. This all works fine on the Edit page, but on the Create page, no relations are created in the pivot table.
The strange thing is that if the field has validation, the validation does work! After that however, the $state
is always null
and the data is not saved.
Again: Everything works on the Edit page, just not on the Create page.`
When I create a new record (book in my example) and select two authors in the 'author' Select
field, I expect the book to be created, with the two authors linked via the author_books
table.
Instead, the author_books
table is not touched and the authors
field is empty after the page redirects to the Edit
page for the newly created book.
composer install; php artisan migrate; php artisan db:seed;
(sorry if I missed anything)https://github.com/caswd/replicate-filament-create-with-many-to-many-select-issue
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too