Use attribute from `MorphOne` relationship in a SelectFilter

This is my filter:
Tables\Filters\SelectFilter::make('submission.status')
->options([
'draft' => 'Draft',
'published' => 'Published',
]),
Tables\Filters\SelectFilter::make('submission.status')
->options([
'draft' => 'Draft',
'published' => 'Published',
]),
It crashes with 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\MorphOne returned
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\MorphOne returned
Is there any workaround to allowing morphOne relationships? I don't see a reason why this in particular is excluded.
1 Reply
Joost
Joost13mo ago
Running into the same issue. Did you manage to find a workaround? @Quadrubo
Want results from more Discord servers?
Add your server