relationship select morphMany

Is there any particular reason why this is not supported? It's only one model (in my case user) I have tried the following so far:
Select::make('employees')
->relationship('employees', 'name')
->multiple()
->searchable()
Select::make('employees')
->relationship('employees', 'name')
->multiple()
->searchable()
I got this error: https://flareapp.io/share/yPa2qjp7#F77 this is how i defined the relationship:
public function employees(): MorphMany
{
return $this->morphMany(User::class, 'assignable');
}
public function employees(): MorphMany
{
return $this->morphMany(User::class, 'assignable');
}
Flare
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\MorphMany returned - The error occurred at http://127.0.0.1:8000/admin/projec...
2 Replies
Dan Harrin
Dan Harrin2y ago
MorphMany is like HasMany maybe you want MorphToMany
DanielvdSpoel
DanielvdSpoelOP2y ago
your right, holy shit lol Thank you so much!
Want results from more Discord servers?
Add your server