Everything New in Livewire 4
Livewire 4 is a major release, and it's packed with features you're going to love. View-based components keep your PHP and Blade together in one file. Islands let you create isolated, independently-updating regions without the overhead of nested components. New directives like wire:sort tackle big things with minimal code. And a powerful JavaScript interceptor system gives you fine-grained control over every request.
Whether you're upgrading an existing app or starting fresh, this series will walk you through everything new, from the fundamentals to the advanced stuff. Let's dig in.
Series episodes
Getting Started (4)
Welcome to Livewire 4
3m 23sDiscover Livewire 4: tour its new features, learn the vision, and get set up to build reactive interfaces—perfect for upgrades or new projects.
View-Based Components
8m 43sCo-locate PHP and Blade in a single file with Livewire 4's view-based components, single or multi-file formats for easier discovery and maintenance.
Page Components
5m 41sBuild entire pages with Livewire using Route::livewire—manage layouts, page titles, and namespaces for organized, maintainable apps.
Installing Flux
3m 36sInstall Flux, Livewire's official UI library, to get beautiful form controls, cards, and layouts so you can build polished apps quickly.
Testing (3)
Unit Testing
5m 29sLearn Livewire unit testing with Pest: test component state, trigger actions, and assert rendered output for reliable, maintainable apps.
Browser Testing
5m 22sWrite Playwright-powered browser tests with Pest v4 and Livewire: run real browsers, click, type, and verify behavior as users experience it.
Co-locating Tests
4m 43sKeep tests next to components with Livewire's artisan commands—learn when co-located tests simplify organization and speed developer workflow.
Loading States (3)
Loading States with data-loading
8m 54sUse Livewire 4's data-loading attribute with Tailwind variants to style loading states directly in markup—no wire:target or workarounds needed.
Lazy Loading Placeholders
3m 22sUse Livewire's @placeholder directive to add skeleton loaders and spinners in component templates, keeping lazy-loading UI simple and concise.
Bundling Lazy Requests
5m 37sCombine lazy Livewire requests with the bundle parameter to group deferred components into one network call - fewer requests, faster pages.
Composition (3)
Forwarding Attributes
3m 7sForward HTML attributes in Livewire: pass classes and Alpine directives into components and apply them to inner elements for cleaner, reusable UI.
Slots
8m 12sMaster Livewire slots: pass Blade content into child components while preserving parent reactivity for cleaner, flexible component composition.
Optimistic UI with wire:show
4m 14sBuild snappy, optimistic UIs with Livewire's wire:show and wire:text — toggle elements instantly client-side for faster, smoother user interactions.
Islands (5)
Islands
5m 34sLearn Livewire 4 Islands to create isolated, independently updating regions for better performance without extra files, props, or events.
Named Islands
4m 53sName your Islands to group and target updates with wire:island—learn naming strategies to control re-renders and sync components.
Lazy Islands
4m 5sUse Lazy Islands to defer expensive parts until after page load—keep your page fast while slow components load when ready.
Nested Islands
6m 40sMaster nested Islands to control component re-renders, use always:true for forced updates, and learn when nesting improves performance.
Appending to Islands
11m 34sLearn to append content with wire:island.append for infinite scroll, pagination, and real-time feeds—efficient updates without re-rendering lists.
Drag and Drop Sorting (1)
JavaScript (6)
Element Refs with wire:ref
4m 15sName elements with wire:ref to target DOM or components, access $refs, dispatch events, and stream content to specific locations.
Tracking Dirty State
4m 50sUse $wire.$dirty() to detect unsaved changes in Livewire properties, show indicators, disable buttons, and provide instant UI feedback.
JSON Methods
7m 20sMark actions with #[Json] to return JSON to Alpine or vanilla JS without re-rendering — fetch data and handle success or validation via promises.
JavaScript Actions
3m 59sEasily run lightweight client-side code in Livewire using $js: define JS functions in your component and call them from wire directives.
Action Interceptors
9m 31sControl Livewire actions with $wire.intercept(): cancel requests, show loaders, save scroll, and run custom side effects before server calls.
Request Interceptors
7m 55sHook every Livewire request globally with interceptors — handle session expiration, custom redirects, logging, and automatic error recovery.




