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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-hotwire

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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

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:

  1. Copy JS and CSS scaffolding to resources/
  2. Add @hotwired/stimulus, @hotwired/turbo and @emaia/stimulus-dynamic-loader to your package.json
  3. 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 by hotwire:check once 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 --force is used).

After installation, a good next step is:

  1. Browse the package docs in the terminal to see what is available
  2. Publish the Stimulus controllers you actually want to use
  3. Run hotwire:check to 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:

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. modalresources/js/controllers/modal_controller.js, identifier modal). Controllers under a substrate folder preserve that folder and use Stimulus' -- separator (e.g. turbo/progressresources/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 own tabs_controller.js), the tooling treats it as an outdated copy of the package controller — hotwire:controllers --force (or --outdated --force) and hotwire:check --fix will overwrite it without prompting. Before naming a new controller, check the taken names with php artisan hotwire:controllers --list and 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 usagedata-controller attributes and the stimulus_controller() / stimulus()->controller() / ->controllers() / stimulus_action() / stimulus_target() helpers — then verifies two things:

  1. Stimulus controllers — every controller required by a used component, or referenced directly, is published and up to date.
  2. npm dependencies — every external package imported by those controllers (e.g. @emaia/sonner, tippy.js) is declared in your package.json (dependencies or devDependencies).

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:check asks whether to run the detected package manager install command after adding dependencies. In non-interactive scripts, use --fix --install to 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:

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

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^12.0||^13.0
emaia/laravel-hotwire-turbo Version ^0.11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package emaia/laravel-hotwire contains the following files

Loading the files please wait ...