- What Laravel versions does Breeze officially support?
- Breeze is officially designed for Laravel 11.x and earlier. Laravel 12+ projects should use Laravel’s newer starter kits, as Breeze may not align with breaking changes in newer versions. Always check the [Laravel documentation](https://laravel.com/docs) for the latest recommendations.
- Can I use Breeze with an existing Laravel project that has a custom users table?
- Breeze assumes a standard `users` table with `email` and `password` fields. If your schema differs, you’ll need to manually adjust migrations, models, and Breeze’s controllers. For complex customizations, consider extending Breeze’s logic or using a more flexible package like Fortify.
- How do I install Breeze for a React/Vue frontend?
- Run `composer require laravel/breeze --dev` and then `php artisan breeze:install react` (or `vue`). This sets up Inertia.js, Vite for asset compilation, and pre-configured React/Vue components. Ensure Node.js and npm/pnpm/bun are installed, as Breeze relies on frontend tooling.
- Does Breeze support API authentication for SPAs or mobile apps?
- Yes, Breeze includes Sanctum for API authentication. Use the `api` stack during installation (`php artisan breeze:install api`) to enable Sanctum’s token-based auth. Adjust CORS settings in `config/sanctum.php` for production, as default settings may only allow localhost.
- Is Breeze suitable for projects needing OAuth or 2FA?
- Breeze provides basic authentication out of the box but lacks built-in OAuth or 2FA. You’ll need to extend it manually or integrate third-party packages like Laravel Socialite for OAuth or Laravel 2FA for two-factor authentication. This adds complexity but remains feasible.
- How do I customize Breeze’s registration or login logic?
- Override Breeze’s controllers (e.g., `RegisterController`) or requests (e.g., `RegisterRequest`) in your `app/Http/Controllers/Auth` directory. Extend the base classes and modify validation rules or business logic. For example, add custom fields to the registration form by editing the Blade/Inertia views and corresponding form requests.
- What testing tools does Breeze support, and how do I write tests?
- Breeze uses Pest by default, but it’s compatible with PHPUnit. Tests are located in `tests/Feature/Auth` and cover registration, login, and password resets. To add custom tests, follow Laravel’s testing conventions, such as using `actingAs()` for authenticated requests or `assertSessionHas()` for redirects.
- Can I switch from Blade to Inertia/React post-installation?
- Switching stacks post-installation requires refactoring views and routes. For example, replace Blade views with Inertia components and update route definitions. This process is non-trivial and may introduce bugs, so plan your frontend stack early. Breeze’s modularity helps, but some manual adjustments are inevitable.
- Are there performance concerns with Breeze’s Tailwind/Vite setup?
- Breeze’s Tailwind CSS and Vite integration are lightweight but may increase asset bundle size. Optimize by enabling Vite’s eager prefetching (`'build.assetsDir': 'assets'`) and purging unused Tailwind classes. For production, run `npm run build` and enable Laravel’s cache (`php artisan config:cache`).
- What are the alternatives to Breeze for Laravel authentication?
- For more feature-rich solutions, consider Laravel Jetstream (includes teams, sessions, and API support) or Fortify (headless auth for SPAs). If you need OAuth, Laravel Socialite is a standalone package. Breeze is ideal for minimal, opinionated auth, while these alternatives offer broader functionality at the cost of complexity.