Select with live() and searchable()
Hi all,
I am trying to make a double select (depending on relation) that is searchable.
First of all I made a new component with
artisan make:form-field
to create a re-usable component. This component has the following schema, pretty much following the documentation
However if I add ->searchable()
to the first select it appears to stop working. The 2nd dropdown isn't populated according to the query (just stays empty) There is no error message really.3 Replies
I have a feeling that it might be because the
category
is not actually a field in my model's data properties?$get('_stabu_selector'))
shouldn't be $valueToSearchFor
?Yeah it is, I was just trying to make it more clear by removing domain code π
Updated my code above
Either way,
$valueToSearchFor
is always null so I think that is because it isnt actually a property on my model
category
isnt actually a field in this case its just a "helper" field to make searching for the final category in sub_category
easier
Hmm, the issue might be circumvented. I need that selector in a repeater and then it works