Skip to content

Laravel Forge + Breeze Default Views#476

Closed
rcravens wants to merge 29 commits intolaravel:2.xfrom
rcravens:rlc_dev
Closed

Laravel Forge + Breeze Default Views#476
rcravens wants to merge 29 commits intolaravel:2.xfrom
rcravens:rlc_dev

Conversation

@rcravens
Copy link

Problem This Solves

I recently created a Laravel 12 application using the following options:

  • Starter Kit = none
  • Test Framework = pest
  • Database = SQLite
  • Run NPM Install / Build = Yes

After some development, I realized that I would like to add authentication. I installed Laravel Fortify to handle all the backend routes / middleware / etc. I then manually pulled in the Laravel Breeze views.

*** NOTE: Pulling in Laravel Breeze (without this change) and then running 'php artisan breeze:install' over-writes a lot of files that have been developed. I tried that path once and then decided to manually pull in what I needed.

Changes

src/Console/InstallCommand.php

  1. Added new InstallsForgeDefaultStack trait
  2. Added new "forge-default" option to the $signature
  3. Updated "handle" with new option
  4. created installNodeModules() function. This feels like "repeated code" in the other options (I didn't refactor those).
  5. created appendToFile() function. This allows files to be appended to instead of being replaced
  6. added "forge-default" to promptForMissingArgumentUsing() method
  7. added "forge-default" to the afterPromptingForMissingArguments() method for dark option

src/Console/InstallsForgeDefaultStack.php (new file)

stubs/forge-default (new directory with assets)

@rcravens
Copy link
Author

BTW, I could not figure out the failing tests. I updated this to tailwindcss v4 (package.json), modified the vite and tailwind config to support this change and deleted the postcss.config.js as it is no longer needed. When i do the following on my machine, the assets build:

laravel new test_app

  • Starter Kit = none
  • Test Framework = pest
  • Database = SQLite
  • Run NPM Install / Build = Yes

composer require "laravel/breeze"
php artisan breeze:install

  • Stack: Laravel Forge + Blade Views (new option)
  • Dark Mode Support: yes
  • Testing Framework: Pest

this results in a working app and "npm run build" successfully completes.

It feels like I am missing something about the github workflows / build. Anyone?

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@rcravens
Copy link
Author

released as a package: https://packagist.org/packages/rcravens/breeze

@rcravens
Copy link
Author

I did release a video (https://tekcasts.com/play/pragmatic-laravel-new-fortify-breeze-package ) that walks through the "why" and "how" of this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants