Select options not populating
Kindly assist, having challenge with my select form field, in searchable mode, it does not populate the options when in editing and only populates on create when I set default to empty string (''). What could be the issues?
21 Replies
Remove default() and add: preload() Does it show then?
@toeknee just tried it but gives an empty options result
What is your relationship function
its a belongs to relationship :
public function company()
{
return $this->belongsTo(Company::class);
}
Do you have any scopes on Company::class
have only soft deletes
used ->getSearchResultsUsing(...) and got same result
Do you have telescope etc installed so you can see the query being run when searching?
This is the screenshot from telescope its responding fine from the endpoint but the options are not populate on the client side
on the browser console, I get this error:
But you want to look at the query
the query seems fine or is there something am not doing right or missing?
Are you using the panel builder or only the form builder?
am using the panel builder
Filament version?
3.0
current version is 3.2.28
yeah am aware, we have some dependencies currently in used that is preventing us from upgrading to Laravel 10, which implies we cant use the latest filament version at the moment.
Is this issue peculiar to the version?
hum, I don't know. You could try the same resource on a fresh install using the current version
Alright. Thanks. I will give it a try and see what becomes the outcome.
@Leandro Ferreira just tried with a new project install and latest filament version and it works fine.
@Leandro Ferreira found the issue for v3.0, actually a JS issue, it assumes the state will always be an array and when its is not, trying to use "includes" fxn fails.
Is there a way I can have an exact copy or another edition of "public/js/filament/forms/components/select.js" with the fix published instead of that coming from filament vendor?
If I were you, I would update laravel/filament
Yeah I wish I could do same, its a legacy project with lots of dependencies that are not compatible with laravel 10 and currently in use.