Eloquent results to options array for Select #10
-
A common usecase is to get results from a database query (in this case Laravel Elequent) to drive the options for a Select drop down. I'm finding I need to take the elequent results and drive a server side foreach loops to recreate an array that works for FormKit and the Select Options array and pass it over with formkit-addon-inertia. Do you have any recommendations on how to take output from a Laravel query and more directly drive the Options array? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You can Do you have any ideas on what could be added to help with this? maybe a helper function, or maybe when the |
Beta Was this translation helpful? Give feedback.
In FormKit there is the
placeholder
, where a value can be represented as "default" for an emptyoption
.