ralphjsmit
Explore posts from serversHow to use Alpine in Filament?
An alternative, you can also do it like this: https://livewire.laravel.com/docs/properties#accessing-properties-from-javascript
26 replies
How to use Alpine in Filament?
And that also goes two-ways, if your TextInput or ColorPicker state updates, then the
$my_text_input
gets updated, Livewire/Alpine knows that it is entangled as well with your custom x-data
and then it gets updated both26 replies
How to use Alpine in Filament?
If you update the
my_text_input
, then Alpine is entangled with the $my_text_input
on the server. That means that if you update that property in Alpine, the $my_text_input
property also gets updated on the server. In turn, your TextInput or ColorPicker is also entangled with $my_text_input
, so if $my_text_input
updates, your TextInput or ColorPicker also updates.26 replies
How to use Alpine in Filament?
Also, I would personally not recommend creating individual properties for all of them, but just to add
public ?array $data = null
and then $form->statePath('data')
, then you will only have just one property on your Livewire. And then in Alpine you do state: $wire.entangle('state').live
.26 replies
How to use Alpine in Filament?
Ah! This works just the same as sharing any other Livewire state with JS, with the only difference that the LW property is also written/read by Filament in addition to your own reads/writes.
Try
See https://livewire.laravel.com/docs/alpine#sharing-state-using-wireentangle
26 replies
Laravel Vapor gzip
Livewire injecting features comes after all the middleware because it listens to the RequestHandled event. If the response then already is gzipped or brotli'd, then it will not inject the assets and you get this empty page type of thing.
7 replies