F
Filament12mo ago
jals65

Relationships in filters.

Hi, I have 2 models related: Projects and Repository. The project has one repository. In the project model, the reporitory is telated using this a repository function with hasOne. In the table of projects, the repository version is printed correctly, but now I'm trying to add a filter about that version. I need a select filter of the available versions to filter projects by repository version. But i'm getting this error:
Filament\Forms\Components\Select::getRelationship(): Return value must be of type Illuminate\Database\Eloquent\Relations\BelongsTo|Illuminate\Database\Eloquent\Relations\BelongsToMany|Illuminate\Database\Eloquent\Relations\HasOneThrough|Znck\Eloquent\Relations\BelongsToThrough|null, Illuminate\Database\Eloquent\Relations\HasOne returned
Filament\Forms\Components\Select::getRelationship(): Return value must be of type Illuminate\Database\Eloquent\Relations\BelongsTo|Illuminate\Database\Eloquent\Relations\BelongsToMany|Illuminate\Database\Eloquent\Relations\HasOneThrough|Znck\Eloquent\Relations\BelongsToThrough|null, Illuminate\Database\Eloquent\Relations\HasOne returned
No description
No description
1 Reply
jals65
jals65OP12mo ago
the problem is caused because Selectfilter doesn't support HasOne relationship, but why?
Want results from more Discord servers?
Add your server