emaia / laravel-hotwire
The complete Hotwire stack for Laravel — Turbo Drive, Turbo Streams, Stimulus controllers and Blade components out of the box.
Package info
github.com/emaia/laravel-hotwire
Language:JavaScript
pkg:composer/emaia/laravel-hotwire
Fund package maintenance!
Requires
- php: ^8.3
- ext-dom: *
- ext-libxml: *
- ext-mbstring: *
- emaia/laravel-hotwire-turbo: ^0.12.0
- illuminate/contracts: ^12.0||^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pao: ^1.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0||^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
This package is auto-updated.
Last update: 2026-08-29 16:30:43 UTC
README
Laravel Hotwire
Laravel Hotwire is a server-driven UI toolkit for Laravel applications. It combines Turbo Drive, Turbo Frames, Turbo Streams, Stimulus controllers and Blade components so you can build fast, reactive interfaces with server-rendered HTML and focused client-side behavior.
Requirements
Laravel Hotwire requires PHP 8.3+, Laravel 12+, Vite, Tailwind CSS v4 and the DOM, libxml and mbstring PHP extensions.
Installation
Install the package with Composer:
composer require emaia/laravel-hotwire
Then scaffold the JavaScript, CSS and package dependencies:
php artisan hotwire:install
The installer adds Stimulus, Turbo, @emaia/stimulus-lazy-loader, controller-specific npm dependencies, the @hotwire
Vite alias, the controller loader, CSS preset imports and Laravel Idea metadata. Components work immediately after
installation. You only publish controllers when you want to customize their source.
Publish configuration only when you need to change the component prefix or controller loading policy:
php artisan vendor:publish --tag=hotwire-config
For lean installs, CI flags and loader details, see Advanced installation.
Documentation
| Basic usage | Blade components and auto-loaded Stimulus controllers |
| Components | Composable Blade primitives for forms, overlays, navigation, feedback and display |
| Controllers | Standalone Stimulus behavior with direct links to each controller contract |
| Turbo Streams | Request detection, DOM helpers and fluent stream responses |
| Frame-backed modals | Shared modal hosts driven by Turbo Frames and regular Blade responses |
| Stimulus helpers | Fluent helpers for controllers, actions, targets, values, classes and outlets |
| Styling and theming | Semantic tokens, preset hooks, dark mode and application overrides |
| Extending controllers | Subclass package controllers or publish their source for customization |
| Recipes | Practical patterns for Turbo, overlays, forms, streams and component composition |
| Registry | Catalog metadata, categories, dependencies, docs paths and styling hooks |
| Advanced installation | Lean installs, critical controller loading, CI flags and loader details |
| Upgrade guide | Version-specific migration notes and compatibility changes |
Browse the same catalog from the terminal:
php artisan hotwire:docs php artisan hotwire:docs modal --component php artisan hotwire:docs auto-submit
Components
Laravel Hotwire ships composable Blade components for common server-rendered UI patterns:
List everything available in your installed version:
php artisan hotwire:components php artisan hotwire:docs --list --component
Controllers
Package controllers auto-load from the vendor directory after hotwire:install. Use them directly with
data-controller, or through the Blade components that mount them for you.
Standalone controllers include:
Publish a package controller only when you want to customize its source:
php artisan hotwire:controllers carousel php artisan hotwire:controllers --list php artisan hotwire:controllers --outdated --force
Styling
hotwire:install configures the default preset and Tailwind source scan.
Override semantic hooks after the preset:
[data-slot="button"][data-variant="default"] { @apply bg-indigo-600 text-white hover:bg-indigo-700; }
Or generate an application-owned preset:
php artisan hotwire:make-preset brand php artisan hotwire:make-preset brand --from=nova
For a layout with an explicit component set, generate a smaller visual bundle while retaining the shared structural foundation:
php artisan hotwire:styles \ --components=badge,button,field,input,navbar,pagination \ --include=tooltip \ --output=resources/css/hotwire-front.css
Check Your Setup
Check the controller loader, npm dependencies, published customizations and selective CSS coverage:
php artisan hotwire:check php artisan hotwire:check --fix php artisan hotwire:check --fix --skip-install
hotwire:check --fix regenerates the controller loader and adds missing npm dependencies. By default it also runs the
detected package manager install command; use --skip-install when CI handles that separately.
Development
composer test composer analyse bun run test bun run test:css bun run test:browser composer format
bun run build:css compiles every public preset plus a bundle generated by hotwire:styles and reports raw/gzip sizes. After an
intentional output change, refresh the committed size baseline with bun run test:css:update.
The registry in src/Registry/catalog.php is the source of truth for package components,
controllers, npm dependencies, docs paths and styling hooks. Update it whenever you add or rename a package component or
controller.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome via pull requests.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.