Atai Kulmambetov
Atai Kulmambetov
FFilament
Created by JJSanders on 2/26/2024 in #❓┊help
Set the label of a select using $set
I have Driver, Vehicle and Contract fields
Select::make('contract_id')
->native(false)
->label('Rental Contract type')
->relationship(name: 'contract', modifyQueryUsing: fn(Builder $query, Get $get) => $query->where('driver_id', $get('driver_id')))
->getOptionLabelFromRecordUsing(function (Contract $contract) {
return $contract->vehicle->body_number . " - " . $contract->title;
})
->preload()
->live(debounce: 50)
->required()
Select::make('contract_id')
->native(false)
->label('Rental Contract type')
->relationship(name: 'contract', modifyQueryUsing: fn(Builder $query, Get $get) => $query->where('driver_id', $get('driver_id')))
->getOptionLabelFromRecordUsing(function (Contract $contract) {
return $contract->vehicle->body_number . " - " . $contract->title;
})
->preload()
->live(debounce: 50)
->required()
The form also has a field for changing the vehicle body number. After this, I need to update the label in the "contract_id" field since its label contains vehicle body number
13 replies
FFilament
Created by JJSanders on 2/26/2024 in #❓┊help
Set the label of a select using $set
Hello @JJSanders How you resolved this? I'm having the same problem. Please help
13 replies