Updating state for laravel-model-states from a Filament form
(I created an SO post yesterday, which includes additional details: https://stackoverflow.com/questions/77233881/updating-model-state-laravel-model-state-from-a-filamentphp-livewire-form)
If it helps, here is the error: https://flareapp.io/share/95JDOL4P
I'm trying to allow changing state (implemented with spatie/laravel-model-states) from a FilamentPHP Resource. In order to get the state to integrate correctly, I had to implement
However, the value of
If it helps, here is the error: https://flareapp.io/share/95JDOL4P
I'm trying to allow changing state (implemented with spatie/laravel-model-states) from a FilamentPHP Resource. In order to get the state to integrate correctly, I had to implement
Wireable. What that brings with it is expecting the saved data to be an array, as can be seen in Livewire\Features\SupportWireables\WireablyeSync.php -> hyrdate:However, the value of
$value received there is a string. I'm not sure if I'm implemented something incorrectly, or if I need to do additional work. I've tried looking for something that lets me manipulate the data which I haven't found. At this point I'm tossing around a couple ideas:- Do I need a custom Livewire component that displays the FilamentPHP form and has a method for changing state.
- Should I try creating a custom action, and within
EditInventoryItemadd it togetHeaderActions - [open to suggestions]
Stack Overflow
I am using using spatie/laravel-model-states in a FilamentPHP (v3) project. In order to get the state to show correctly in the form, I had to implement Wireable in the state class, that looks like ...
Flare
foreach() argument must be of type array|object, string given - The error occurred at https://asset-tracker.lndo.site/dashboard/inventory-items/2/edit