Select form is returning null when I make it searchable

Select form is returning null when I make it searchable
No description
6 Replies
christmex
christmex5mo ago
when u dd() is the data exist? if yes, maybe you can try to add optionlimit? set it maybe 10?
KingNii
KingNiiOP5mo ago
@christmex It's completely null
KingNii
KingNiiOP5mo ago
@christmex
No description
Lindiar Miftari
Lindiar Miftari5mo ago
Select::make('lga')
->label('Local Goverment Area')
->options(Lga::all()->pluck('name','id')
->preload()
->required()
->searchable()
Select::make('lga')
->label('Local Goverment Area')
->options(Lga::all()->pluck('name','id')
->preload()
->required()
->searchable()
KingNii
KingNiiOP5mo ago
@Lindiar Miftari tried your solution and still got null if I can't use searchable, I would like to limit wards data to lga ID,
->options(Lga::all()->pluck("name", "id")->toArray()),
// ->required(),
Select::make('ward')
->label('Ward')
// ->searchable()
->preload()
->options(Ward::all()->where('lga_id', $this->data['lga'] ?? '')->pluck("name", "id")->toArray()),
->options(Lga::all()->pluck("name", "id")->toArray()),
// ->required(),
Select::make('ward')
->label('Ward')
// ->searchable()
->preload()
->options(Ward::all()->where('lga_id', $this->data['lga'] ?? '')->pluck("name", "id")->toArray()),
Bute it's not working
toeknee
toeknee5mo ago
searchable limits to 50 anyway, can be increased else where Cha nge your options to closures too:
fn() => Ward:all
fn() => Ward:all
Want results from more Discord servers?
Add your server