Laravel Breeze with Bootstrap
I just released guizoxxv/laravel-breeze-bootstrap, a package that provides Bootstrap scaffolding to Laravel Breeze.
For many years, Bootstrap was the default theme for Laravel front-end authentication scaffolding, but it lost support since Laravel version 8 when new starter kits were introduced. I remember that at the time, this was kind of turbulent because many developers were used to the old flow and confused with so many packages (Jetstream, Fortify, Sanctum, Spark, and later Breeze) and options. More details in this podcast with Taylor Otwell.
I was one of those who got frustrated. Unlike others, I already was a Tailwind enthusiast at the time, but while it facilitates development a lot, it does not provide ready-to-use components carefully considering UX principles like libraries such as Bootstrap do. I used Bootstrap a lot on previous jobs, freelance, tests, and PoCs. In one previous employment that didn’t even use PHP, I was able to quickly present an idea using Laravel and Bootstrap that ended up being applied with Node, React, and the company’s own component library.
Of course, you can still use Bootstrap or any other non-officially supported library by customizing Breeze files after installation, creating a front-end for Laravel Fortify, or creating your own authentication, but those options are not as straightforward. You can also still use the legacy laravel/ui package, which contains the old make:auth
logic, but it is not recommended. In my opinion, it is much better to build on top of the authentication code provided by Breeze, which is more modern, than UI. In my current job, the application started in Laravel 5 with the old make:auth
command, but Bootstrap was never used. Currently, it runs on Laravel 10, the authentication assets and logic were customized and work together with Laravel Passport.
Later I better understood the reasoning behind the changes and I agree with not having official support for Bootstrap or any other component library, but I wish Breeze allowed easier customization. Check out this discussion.
In 2023, I opened a PR to introduce macros in Breeze to allow using third-party stacks during installation. but it was denied because it could limit things for Breeze development, which makes sense. I stopped working on it until I recently needed it again. I changed the approach by extending the Breeze command and overriding the handler to generate the assets for Bootstrap.
Hope it helps.