hotwired-laravel / hotwire-starter-kit
A Hotwire Starter Kit for Hotwire
Package info
github.com/hotwired-laravel/hotwire-starter-kit
Language:JavaScript
Type:project
pkg:composer/hotwired-laravel/hotwire-starter-kit
Requires
- php: ^8.3
- blade-ui-kit/blade-heroicons: ^2.6
- hotwired-laravel/stimulus-laravel: ^1.5
- hotwired-laravel/turbo-laravel: ^2.6
- laravel/fortify: ^1.33
- laravel/framework: ^13.0
- laravel/tinker: ^3.0.0
- tonysm/importmap-laravel: ^2.5
- tonysm/tailwindcss-laravel: ^2.3
Requires (Dev)
- fakerphp/faker: ^1.24
- hotwired-laravel/hotreload: ^0.0.10
- larastan/larastan: ^3.10
- laravel/pail: ^1.2.5
- laravel/pint: ^1.27
- laravel/sail: ^1.53
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.9
- pestphp/pest: ^4.4
- pestphp/pest-plugin-laravel: ^4.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A community-built starter kit to build Hotwired apps with Laravel.
Hotwire is an alternative approach to building modern web applications without using much JavaScript by sending HTML instead of JSON over the wire.
This Hotwire Starter Kit comes with:
- Turbo Laravel
- Tailwind CSS Laravel and Importmap Laravel for a #nobuild frontend setup (but it also works with Vite, if you want to use that)
- Stimulus Laravel to make it easier to create Stimulus controllers and Hotwire Native Bridge Components
- Hotwire Hotreload installed as a dev dependency to make development easier
- daisyUI component library integrated
Hotwire Native
It also comes ready to be integrated with Hotwire Native, which is a web-first framework for building native mobile apps. It provides you with all the tools you need to leverage your web app and build great mobile apps.
If you want to see an example, check out this Native Android app.
Requirements
- PHP 8.3+
- Composer
- The Laravel Installer
No Node.js required.
Installation
You can use the Laravel Installer to set up the Hotwire Starter Kit.
laravel new my-app --using=hotwired-laravel/hotwire-starter-kit --pest --no-node
If you want teams support, make sure you use the teams branch (dev-teams):
laravel new my-app --using=hotwired-laravel/hotwire-starter-kit:dev-teams --pest --no-node
Local Development
We ship with a Procfile, so you may run it with foreman, node-foreman or, our recommended way since it only requires a single binary, Overmind. Download the binary, put it somewhere in your $PATH, then run:
composer run dev
The dev script runs overmind start under the hood. If you're using foreman or node-foreman instead, run foreman start (or nf start) directly.
Running with Docker
If you prefer Docker, the starter kit ships with a Laravel Sail compose.yaml file:
vendor/bin/sail up -d
Deployment
Deploying a Hotwired Laravel app is just like deploying any other Laravel app. It only differs a bit because we're using Tailwind CSS Laravel and Importmap Laravel, so make sure you add these steps to your deploy script:
# Build the Tailwind CSS styles... php artisan tailwindcss:download php artisan tailwindcss:build --prod # Copy JavaScript files and generate the production manifest... php artisan importmap:optimize
If you're uploading your assets to a CDN (like in Vapor), make sure you set the ASSET_URL before running these commands, since the Importmap manifest will be created using the full URL, which relies on this environment variable.
We also ship with a production Dockerfile (based on serversideup/php) that already runs these steps for you.
For more information, head over to the Tailwind CSS Laravel and Importmap Laravel documentation.
Contributing
Thank you for considering contributing to our starter kit! Please feel free to open issues and send pull requests if you think something could be done differently.
License
The Laravel + Hotwire Starter Kit is open-sourced software licensed under the MIT license.