© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Quadrubo

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.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to use nested relationship in SelectFilter?
FilamentFFilament / ❓┊help
3y ago
Use 1 attribute for 2 SelectFilter
FilamentFFilament / ❓┊help
2y ago
SelectFilter relationship field
FilamentFFilament / ❓┊help
3y ago
FileUpload Image with morphOne relationship
FilamentFFilament / ❓┊help
3y ago