Installation

From Composer to your first component

Install the PHP package, let Artisan scaffold the browser stack, and keep building with the Laravel conventions already in your application.

Advanced installation

PHP

8.3 or newer

Laravel

12 or newer

CSS

Tailwind CSS

Bundler

Vite

1

Require the package

Composer discovers the service provider and registers the Blade components, helpers, and Artisan commands.

Terminal
composer require emaia/laravel-hotwire
2

Run the installer

One command wires the browser stack into your app.

Terminal
php artisan hotwire:install
  • Turbo and Stimulus
  • Lazy controller loading
  • Tailwind preset
  • Vite @hotwire alias
  • npm dependencies
3

Start Laravel and Vite

The Composer development script starts Laravel, the queue worker, application logs, and Vite together.

Terminal
composer dev
4

Render your first component

Paste this into any Blade view. Click Open dialog to try it: the component handles opening, keyboard dismissal, and focus without any JavaScript of your own.

Blade
<hw:modal size="sm">
    <hw:modal.trigger>Open dialog</hw:modal.trigger>

    <hw:modal.content>
        <hw:modal.header>
            <hw:modal.title>Hello, Hotwire!</hw:modal.title>
            <hw:modal.description>
                Your first component is working.
            </hw:modal.description>
        </hw:modal.header>
    </hw:modal.content>
</hw:modal>

Preview

5

Verify before you ship

hotwire:check compares component usage, controller loading and npm dependencies. --fix resolves the drift it finds.

Terminal
php artisan hotwire:check
php artisan hotwire:check --fix

Laravel Boost

Give your coding agent version-aware Hotwire guidance

Install Boost and select emaia/laravel-hotwire when prompted. Your agent gets guidance matched to the installed version and component prefix.

Terminal
composer require laravel/boost --dev
php artisan boost:install

Package-aware context

Agents see the active prefix and current component and controller catalog.

Focused skills

Forms, Turbo workflows, UI composition, and Stimulus guidance load only when relevant.

Grounded APIs

Agents use local hotwire:docs and hotwire:check instead of inventing props or configuration.

Dependency modes Install only what the application needs

Optional. Runtime code is always split by Vite; these modes decide which third-party integrations enter the build.

Terminal
# Install every catalog dependency
php artisan hotwire:install

# Keep only controllers without optional dependencies
php artisan hotwire:install --core-only

# Opt in to selected third-party integrations
php artisan hotwire:install --with-deps=carousel,chart,map
Full catalog
For exploration and apps that use many integrations.
Core only
Zero-dependency controllers, no third-party npm packages.
Selected integrations
Only the libraries the named controllers require.

Installation complete

Pick the building blocks for your first screen.

Continue to components