Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Darkdawg's avatar

Darkdawg started a new conversation+100 XP

3mos ago

Livewire #Modelable not working with v4 SFC?

Hey!

I created a SFC for a Flux:select, using the Modelable attribute. However, when triggering a save from the parent component the value isn't grabbed from the child. I'm using wire:model without any modifiers.

Changing to wire:model.live works, but I don't want the redundant requests.

This works with the old class based components, so I'm wondering if this is a bug?

Darkdawg's avatar

Darkdawg liked a comment+100 XP

4mos ago

Darkdawg's avatar

Darkdawg wrote a comment+100 XP

4mos ago

Everything New in Livewire 4: Ep 2, View-Based Components

Love Livewire!

I'm running Livewire in a somewhat weird way these days. I store the full page response as plain html pages, stripping out CSRF tokens and anything dynamic using middlewares and such. On page load I inject them again using fetch requests and cookies.

Livewire is still there, I just use the manual Livewire.start() approach to ensure CSRF tokens are injected before booting it. Works great, and I can now serve the whole app through a CDN like Cloudflare, giving me instant response times. Any Livewire update request just goes straight back to the server as usual. Just gotta make sure the cache gets busted on updates, but that's simple enough.