ToggleButtons in RelationManager Attach getting Error "Array to string conversion"
When trying to Attach new item with Pivot getting Array to String Error, with Edit working fine.
Here are codes:
Models
6 Replies
New Group and Attach getting Error
How to Solve this?
Edit and Detach working fine
Anyone please help to solve an issue
GitHub
RelationManager with Pivot and Select Multi · filamentphp filament ...
Hi, it s possible to add multi select for pivot column in relation manager ? Example : But when i attach i have an error : "Array to string conversion" Thanks !
But also there I didn't find solution
Also no matter what i use ToggleButton, Checkbox List, or Select...
Please do not email me questions in the future, if everyone did that I would have no time left.
You have put a cast on each model, but the column is not on the model, its on the pivot table
so you need a withCasts() on each relationship for these pivot attributes, or define a pivot model with $casts
here is the latter https://laravel.com/docs/11.x/eloquent-relationships#defining-custom-intermediate-table-models
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Thanks Dan, problem solved!