Saved data not showing in multiselect field
What I am trying to do:
Displaying the data that is picked from the multiselect.
What I did:
Made a new column in the database:
Set cast to array & added it as fillable in the model.
Then in my resource added the following:
My issue/the error:
Values are saved correctly in the database, but when i reopen the form the multiselect field is empty. So it's not showing the values i just saved. When i then save the fields again it saves an empty array.
9 Replies
When you save and dump the data, what does it actually return? Like
dd($yourModel->value_types)
?Can you add
->rules(['array'])
to your component ?
I had a similar issue where the component needed to validate as an array for it to output the dataThanks for the replies! Will try it monday when i'm back at the office 🙂

It shows when i just saved it, but when i refresh the page or go back to a different one it doesn't show it anymore

Did the database update?
Do you have it as fillable on your model?
Yes database did update
Sounds like the data isn't being refresh, is this on a livewire componebnt?
It's inside a resource