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
This error occure :
Solution
Hi,
you don't need to have following if you are using relationship
Also the relationship must me
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)