Post

Happy Friday! I’ve been chipping away at an approach to writing Blade and Livewire components that smooths out the differences between the two, letting you write and use everything the same way, and also include scripts and styles that get bundled by Vite. 1/3

* Every view is a Blade or Blade+Livewire (via Volt) component * Non-Livewire components can be used as full pages * Livewire components get an attribute bag and can have slots * Layouts are included in exactly the same way in both types * Scripts and styles can use imports/tailwind helpers etc 2/3

If you don’t need Livewire just drop the `<?php` chunk and it’s a regular Blade component. If it’s full page just wrap the template in your layout. And the best thing is this only requires some very minimal hooks into to the blade compiler, a couple of helpers, and a Vite plugin. 3/3

And because Livewire synthesizers are awesome you can wire:model attribute bag values. Not sure about the use cases for this (and the bag is locked by default), but it's still cool. 4/3

0 reposts1 like