Problem using Many to Many relationship, using filament v2.
this is my form
my models
example input
3 Replies
Im creating a LMS for my project
badly need help for this
been debugging for hours
thank you in advance
this is the data shown in the debug
but why is the category_id is not inserting to the category_id or it cant find it
here is the migration file
Your relationships aren’t right. You can’t cast category_id to an array. Both relationships should be a many to many.
if i change both models relationship to has many
it gives me this error
Filament\Forms\Components\Select::getRelationship(): Return value must be of type Illuminate\Database\Eloquent\Relations\BelongsTo|Illuminate\Database\Eloquent\Relations\BelongsToMany|Znck\Eloquent\Relations\BelongsToThrough|null, Illuminate\Database\Eloquent\Relations\HasMany returned