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
christmex4mo ago
when u dd() is the data exist? if yes, maybe you can try to add optionlimit? set it maybe 10?
KingNii
KingNiiOP4mo ago
@christmex It's completely null
KingNii
KingNiiOP4mo ago
@christmex
No description
Lindiar Miftari
Lindiar Miftari4mo 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
KingNiiOP4mo 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
toeknee4mo 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