How do you call a relation attribute in form?
In table I just call : customer.full_name
I know it's not possible that way but can't make it work.
11 Replies
Thanks, it works. But finally it's better if I use this :
The problem is now how can I use this "full_name" attribute here?
->getOptionLabelFromRecord(fn ($record) => $record->full_name)
It gives me a type error : Filament\Forms\Components\Select::getOptionLabelFromRecord(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, Closure given, called in C:\laragon\www\adm.ap\app\Filament\Resources\OrderResource.php on line 35
sorry
->getOptionLabelFromRecordUsing(fn ($record) => $record->full_name)
Thanks, it's very helpful for me π
There's just something strange now, when I search, it appends the default value to the bottom of the search.
thats just the way it works, you didnt do anything wrong
it's in the case you click the delete value on the right?
so you can keep the current value selected
π