hotwired-laravel/turbo-laravel

Add new --alpine (or --breeze) flag to php artisan turbo:install

misog opened this issue · 2 comments

misog commented

Hi, Laravel Breeze (default setup) uses Alpine.js without Jetstream.

However there is just one documented way to make Alpine.js compatible in Turbo and that is with --jet flag.

A new --alpine flag could be added to make Alpine.js compatible with Turbo.

Specifically, this file should be injected with Alpine.js (ex. with Breeze (default setup) and without Jetstream) https://github.com/tonysm/turbo-laravel/blob/main/stubs/resources/js/libs/alpine.js

In general, each flag used by Laravel Breeze could be mimicked by php artisan turbo:install.

Or, just one flag --breeze could generate all files required for every Breeze setup (breeze default/alpine, breeze vue, breeze react, breeze with ssr). This approach would cover both two starter kits in Laravel: Breeze and Jetstream: https://laravel.com/docs/9.x/starter-kits

I see. I like the --alpine option idea. I think there's room for changing a few things here. Maybe we could detect if the app uses Jetstream or Breeze (based on the composer.json) and update the templates accordingly... 🤔

I'll test this out.

The new --alpine flag was added in 1.2.0