Download the PHP package emaia/laravel-hotwire without Composer
On this page you can find all versions of the php package emaia/laravel-hotwire. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-hotwire
Laravel Hotwire
The complete Hotwire stack for Laravel — Turbo Drive, Turbo Streams, Stimulus controllers, and Blade components out of the box.
Table of Contents
- Requirements
- Installation
- Quick Start
- Explore the Docs
- Turbo
- Stimulus Controllers
- Top-level controllers
- Turbo
- Optimistic
- Dev
- Publish Controllers
- Stimulus Attribute Helpers
- Blade Components
- Verify Your Setup
- Configuration
- View Customization
- Extending
- Testing
- Manual Installation
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Requirements
- PHP 8.3+
- Laravel 12+
- Stimulus with a loader compatible with
import.meta.glob( e.g. @emaia/stimulus-dynamic-loader) - Tailwind CSS
- Vite.js
Installation
Publish the configuration file (optional):
Quick Start
The installation command scaffolds the Hotwire setup in your Laravel application — JS entry points, Stimulus loader, Turbo imports, and CSS custom variants:
This will:
- Copy JS and CSS scaffolding to
resources/ - Add
@hotwired/stimulus,@hotwired/turboand@emaia/stimulus-dynamic-loaderto yourpackage.json - Show instructions for the next steps
Only the three core dependencies above are added at installation time. Extra npm packages required by specific components (e.g.
tippy.js,@emaia/sonner) are published on demand byhotwire:checkonce you actually use a component that depends on them.
Options:
If a target file already exists and is identical, it is skipped. If it differs, the command asks for confirmation before overwriting (unless
--forceis used).
After installation, a good next step is:
- Browse the package docs in the terminal to see what is available
- Publish the Stimulus controllers you actually want to use
- Run
hotwire:checkto verify controllers and npm dependencies used by your views
Explore the Docs
You can browse the package docs directly in the terminal:
Interactive search, reading a single doc, and listing everything
This opens an interactive search across all controllers and components. Type a name, category, or keyword to filter: Read a specific controller or component directly: List everything with category and description:Turbo
This package includes emaia/laravel-hotwire-turbo as a dependency, providing full Turbo integration for Laravel:
- Turbo Streams — fluent builder for append, prepend, replace, update, remove, morph, refresh, and more
- Turbo Frames —
<x-turbo::frame>Blade component with lazy loading support - DOM helpers —
dom_id()anddom_class()for consistent element identification - Request detection —
wantsTurboStream()andwasFromTurboFrame()macros - Blade directives —
@turboNocache,@turboRefreshMethod('morph'), etc. - Testing utilities —
InteractsWithTurbotrait withassertTurboStream()assertions
See the full documentation at emaia/laravel-hotwire-turbo.
Stimulus Controllers (standalone)
Stimulus controllers without an associated Blade component. Used directly via data-controller and data-action.
Controllers live flat at the top level (resources/js/controllers/<name>_controller.{js,ts}). Substrate folders
(turbo/, optimistic/, dev/) group controllers tied to a specific technical layer and use Stimulus' -- separator
in the identifier.
Top-level controllers
| Controller | Identifier | Category | Dependencies | Docs |
|---|---|---|---|---|
| Animated Number | animated-number |
utility |
— | readme |
| Auto Save | auto-save |
forms |
— | readme |
| Auto Resize | auto-resize |
forms |
— | readme |
| Auto Select | auto-select |
forms |
— | readme |
| Auto Submit | auto-submit |
forms |
— | readme |
| Autofocus | autofocus |
forms |
— | readme |
| Back to Top | back-to-top |
utility |
— | readme |
| Carousel | carousel |
utility |
embla-carousel |
readme |
| Char Counter | char-counter |
forms |
— | readme |
| Chart | chart |
utility |
echarts |
readme |
| Checkbox Select All | checkbox-select-all |
forms |
— | readme |
| Clean Query Params | clean-query-params |
forms |
— | readme |
| Clear Input | clear-input |
forms |
— | readme |
| Conditional Fields | conditional-fields |
forms |
— | readme |
| Confirm Dialog | confirm-dialog |
overlay |
— | readme |
| Copy To Clipboard | copy-to-clipboard |
utility |
— | readme |
| Disclosure | disclosure |
utility |
— | readme |
| Dropdown | dropdown |
overlay |
— | readme |
| Error Scroll | error-scroll |
forms |
— | readme |
| File Preserve | file-preserve |
forms |
— | readme |
| GTM | gtm |
utility |
— | readme |
| Hotkey | hotkey |
utility |
— | readme |
| Input Mask | input-mask |
forms |
maska |
readme |
| Lazy Image | lazy-image |
utility |
— | readme |
| Modal | modal |
overlay |
— | readme |
| Modal Auto Close | modal-auto-close |
overlay |
— | readme |
| Money Input | money-input |
forms |
— | readme |
| OEmbed | oembed |
utility |
— | readme |
| Password Visibility | password-visibility |
forms |
— | readme |
| Remote Form | remote-form |
forms |
— | readme |
| Reset Files | reset-files |
forms |
— | readme |
| Scroll Progress | scroll-progress |
utility |
— | readme |
| Slug | slug |
forms |
— | readme |
| Tabs | tabs |
utility |
— | readme |
| Timeago | timeago |
utility |
date-fns |
readme |
| Toast | toast |
feedback |
@emaia/sonner |
readme |
| Toaster | toaster |
feedback |
@emaia/sonner |
readme |
| Tooltip | tooltip |
utility |
tippy.js |
readme |
| Unsaved Changes | unsaved-changes |
forms |
— | readme |
Turbo
Controllers tied to Turbo Drive / Turbo Frames.
| Controller | Identifier | Dependencies | Docs |
|---|---|---|---|
| Frame Src | turbo--frame-src |
@hotwired/turbo |
readme |
| Polling | turbo--polling |
@hotwired/turbo |
readme |
| Progress | turbo--progress |
@hotwired/turbo |
readme |
| View Transition | turbo--view-transition |
— | readme |
Optimistic
| Controller | Identifier | Dependencies | Docs |
|---|---|---|---|
| Dispatch | optimistic--dispatch |
@hotwired/turbo |
readme |
| Form | optimistic--form |
@hotwired/turbo |
readme |
| Link | optimistic--link |
@hotwired/turbo |
readme |
Dev
| Controller | Identifier | Dependencies | Docs |
|---|---|---|---|
| Log | dev--log |
— | readme |
Publish Stimulus Controllers
Publish the controllers you want to use in your app so they can be discovered by the bundler (Vite).
Interactive — select which controllers to publish:
By name — publish a specific controller:
Substrate namespace — publish every controller under a substrate folder (turbo, optimistic, dev):
Multiple arguments — mix names and substrate namespaces:
All at once:
List available controllers (with publication status):
Update only controllers that are already published but differ from the package source:
--outdated never installs controllers that haven't been published yet, and skips those that are already up to date.
Overwrite existing files:
Top-level controllers are copied flat to resources/js/controllers/ (e.g. modal →
resources/js/controllers/modal_controller.js, identifier modal). Controllers under a substrate folder preserve
that folder and use Stimulus' -- separator (e.g. turbo/progress →
resources/js/controllers/turbo/progress_controller.js, identifier turbo--progress).
@emaia/stimulus-dynamic-loader discovers and loads
them automatically via import.meta.glob.
If a controller already exists and is identical to the package version, the command reports it as up to date. If it differs, it asks for confirmation before overwriting.
Name collisions: package controller names are effectively reserved in
resources/js/controllers/. If you write your own controller whose file name matches a package one (e.g. your owntabs_controller.js), the tooling treats it as an outdated copy of the package controller —hotwire:controllers --force(or--outdated --force) andhotwire:check --fixwill overwrite it without prompting. Before naming a new controller, check the taken names withphp artisan hotwire:controllers --listand pick a different one.
Stimulus Attribute Helpers
Build Stimulus data-* attributes from Blade without hand-writing the verbose markup. The primary
stimulus() entry point returns a fluent, chainable builder that is Htmlable (renders directly in
{{ }}) and Arrayable (merges into a component's attribute bag):
stimulus_controller() is an alias for stimulus()->controller(...); stimulus_action() and
stimulus_target() are shortcuts for stimulus()->action(...) and stimulus()->target(...).
See Stimulus attribute helpers for values/classes/outlets, action params, stacking multiple controllers, attribute-bag merging and the escaping rules.
Blade Components
| Component | Blade | Category | Stimulus Identifier(s) | Docs |
|---|---|---|---|---|
| Form | <x-hwc::form> |
forms |
auto-submit, unsaved-changes, error-scroll, clean-query-params |
readme |
| Field | <x-hwc::field> |
forms |
— | readme |
| Conditional Field | <x-hwc::conditional-field> |
forms |
conditional-fields |
readme |
| Input | <x-hwc::input> |
forms |
auto-select, clear-input, input-mask |
readme |
| Label | <x-hwc::label> |
forms |
— | readme |
| Select | <x-hwc::select> |
forms |
— | readme |
| Textarea | <x-hwc::textarea> |
forms |
auto-resize, char-counter |
readme |
| File | <x-hwc::file> |
forms |
file-preserve, reset-files |
readme |
| Checkbox Group | <x-hwc::checkbox-group> |
forms |
checkbox-select-all |
readme |
| Description | <x-hwc::description> |
forms |
— | readme |
| Error | <x-hwc::error> |
forms |
— | readme |
| Flash Container | <x-hwc::flash-container> |
feedback |
toaster |
readme |
| Flash Message | <x-hwc::flash-message> |
feedback |
toast |
readme |
| Spinner | <x-hwc::spinner> |
feedback |
— | readme |
| Modal | <x-hwc::modal> |
overlay |
modal |
readme |
| Confirm Dialog | <x-hwc::confirm-dialog> |
overlay |
confirm-dialog |
readme |
| Dropdown | <x-hwc::dropdown> |
overlay |
dropdown |
readme |
| Optimistic | <x-hwc::optimistic> |
turbo |
— | readme |
| Carousel | <x-hwc::carousel> |
utility |
carousel |
readme |
| Chart | <x-hwc::chart> |
utility |
chart |
readme |
| Scroll Progress | <x-hwc::scroll-progress> |
utility |
scroll-progress |
readme |
| Timeago | <x-hwc::timeago> |
utility |
timeago |
readme |
Verify Your Setup
List components and their required controllers:
Shows each Blade component, its tag, and the Stimulus controllers it depends on — with publication status for each.
Check controllers used in your views (components and direct usage):
Scans resources/views for Hotwire components and direct Stimulus controller usage — data-controller
attributes and the stimulus_controller() / stimulus()->controller() / ->controllers() / stimulus_action() /
stimulus_target() helpers — then verifies two things:
- Stimulus controllers — every controller required by a used component, or referenced directly, is published and up to date.
- npm dependencies — every external package imported by those controllers (e.g.
@emaia/sonner,tippy.js) is declared in yourpackage.json(dependenciesordevDependencies).
Exits with code 1 if either has pending items (useful for CI).
Both the configured prefix (hwc by default) and the literal hotwire alias are recognized, so views like
<x-hwc::flash-message /> and <x-hotwire::flash-message /> are detected equally. Only controllers shipped by the
package are checked — your own controllers are ignored — and Blade comments and <script>/<style> blocks are
stripped first, so commented-out code is skipped.
Example output:
In interactive mode,
hotwire:checkasks whether to run the detected package manager install command after adding dependencies. In non-interactive scripts, use--fix --installto run it automatically.
Configuration
Change prefix to use a different prefix for Blade components. E.g. 'prefix' => 'hotwire' → <x-hotwire::modal>.
View Customization
To customize the HTML/Tailwind of the components:
Views published to resources/views/vendor/hotwire/ will take precedence over the package defaults.
Extending the package
Laravel Hotwire uses a single registry as the source of truth for:
- Blade components
- Stimulus controllers
- external npm dependencies
- docs paths
- public categories
When adding a new component or controller to this package, update the registry entry in
src/Registry/catalog.php.
Example component entry:
Example controller entry:
More details: docs/registry.md
Testing
Manual Installation
If you prefer to set things up manually instead of using hotwire:install, follow the steps below.
Project setup (using Vite)
Install the required js dependencies:
TailwindCSS (v4)
Add these settings to your CSS entrypoint resources/css/app.css:
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.
All versions of laravel-hotwire with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^12.0||^13.0
emaia/laravel-hotwire-turbo Version ^0.11.0