Hasan Tahseen
Select Field Relationship have no limit
first. this code will result (timeout exceed error) for relations with big data. please see the implementation of
relationship
method especially the part of $this->options
which will not use (optionsLimit
) in it core which result to load all the data.
secondly. above code is better approach since if I use the (fn ()
) approach will make the callback method in options a computed method which means the select field will fire a livewire request each time I open and close the select field (which is wrong in my example since I will only display static data that will not relay on any other field and will load when the page is loaded). and the using of getSearchResultsUsing
is for searching the records. I will only display 10 or 50 records in the options (and even if I used the fn ()
approach it will not making it searchable by database also with searchable
will not making it search on database). So the only solution here is to specify the limit in the options and the getSearchResultsUsing
method So that all things works as expected.
please read this docs https://filamentphp.com/docs/3.x/forms/fields/select#returning-custom-search-results.13 replies