CheckBoxList relationships error
When i add relationships in creating checkBoxList like shown in the code below :
This error occure :
❌ Filament\Forms\Components\CheckboxList::getRelationship(): Return value must be of type ?Illuminate\Database\Eloquent\Relations\BelongsToMany, Illuminate\Database\Eloquent\Relations\HasMany returned
Solution:Jump to solution
Hi,
you don't need to have following if you are using relationship
->options(Speaker::all()->pluck('name', 'id'))
...2 Replies
Solution
Hi,
you don't need to have following if you are using relationship
->options(Speaker::all()->pluck('name', 'id'))
Also the relationship must me BelongsToMany
instead of HasMany
on the relation (model)Thank you it solved the issue