This application serves as an example of applying Hotwire in Laravel.
It uses:
- Turbo Laravel (via
tonysm/turbo-laravel
package) - Laravel WebSockets (via
beyondcode/laravel-websockets
package) - Many built-in components from Laravel
This app is live. You can test it out at turbo-laravel.tonysm.com.
The local environment relies on Laravel Sail. So, in order to continue, make sure you check out the docs from that.
Install Composer dependencies:
docker run --rm \
-v $(pwd):/opt \
-w /opt \
laravelsail/php80-composer:latest \
composer install
Copy the .env.example
file:
cp .env.example .env
Then you can edit this new .env
file as you want.
Of course you can also add your own file .env
file.
Generate the APP_KEY:
docker run --rm \
-v $(pwd):/opt \
-w /opt \
laravelsail/php80-composer:latest \
php artisan key:generate
Boot the Services Up:
sail up -d
Migrate the Database:
sail artisan migrate
Link the Storage Folder (for Importmap):
sail artisan storage:link
Download Tailwind CSS and Compile:
sail artisan tailwindcss:download
sail artisan tailwindcss:build
Running a Worker:
You will need a queue worker to process Turbo Stream broadcasts in background:
sail artisan queue:work --tries=1
For the Reactions feature, we're using Twemoji and giving attribution here. This is the emoji dataset I'm using in combination with that service.