laravel-dev-tools icon indicating copy to clipboard operation
laravel-dev-tools copied to clipboard

Fix for livewire form properties not being found.

Open Fsmash opened this issue 10 months ago • 1 comments

Fix for nested livewire form properties not being found as discussed in issue https://github.com/haringsrob/laravel-dev-tools/issues/15. Tried to be as unobtrusive as possible. Additional reflection was not necessary since "DataStore" already holds the "BladeComponentData" for Livewire forms.

Only issue is that this fix only supports one level of nesting and the class with the nested properties must also be a Livewire component. I could have made a recursive function and implemented actual reflection for classes not found in the "availableComponents" array, but I don't think that is a good idea. This should be fine since it doesn't support bad programming practices with Livewire. Livewire properties really shouldn't be nested more than one level deep, and they really should be in a Livewire form if they are nested.

Lastly, I wanted to write a test but ran into this issue. Didn't look that deep into it but if it is a simple fix let me know.

image

Fsmash avatar Apr 02 '24 09:04 Fsmash

If anyone can confirm this works I can merge it :)

haringsrob avatar Jul 03 '24 13:07 haringsrob