- How do I install Bloom in a fresh Laravel 10 project?
- Run `composer require emilijus/bloom`, then publish vendor files with `php artisan vendor:publish --tag=bloom`. Finally, install the admin dashboard using `php artisan bloom:install`. Ensure your project uses Laravel Breeze for authentication, as Bloom assumes this stack.
- Can Bloom generate CRUD modules for an existing Laravel project?
- Yes, but ensure your project uses Laravel Breeze for authentication and has a compatible `users` table (with an `is_admin` column). Run `php artisan bloom:install --update-user-table` if the column was lost during migrations, then use `php artisan bloom:create` to scaffold new modules.
- What Laravel versions and PHP versions does Bloom support?
- Bloom is compatible with **Laravel 10+** and requires **PHP 8.2 or higher**. It leverages modern Laravel features like Symfony 6.4 components but has not been tested with Laravel 11 or newer as of now.
- How do I create an admin user with Bloom?
- Use the `--create-admin` flag during installation: `php artisan bloom:install --create-admin`. You’ll be prompted to input admin credentials. This creates a user with the `is_admin` flag set to `true` in the database.
- Does Bloom work with custom authentication systems like Sanctum or Passport?
- No, Bloom assumes Laravel Breeze for authentication. If you use Sanctum, Passport, or another system, you’ll need to manually integrate Bloom’s admin routes or avoid using the package entirely to prevent conflicts.
- Can I customize the generated CRUD views or controllers?
- Bloom allows limited customization by overriding its published views in your project’s `resources/views/vendor/bloom` directory. However, deep customization may require forking the package or manually editing generated files after creation.
- Will Bloom generate API endpoints for my CRUD modules?
- No, Bloom is UI-focused and generates Blade-based CRUD interfaces for admin dashboards. For API endpoints, you’ll need to manually create controllers or integrate with tools like Laravel Sanctum or Nova API resources.
- How do I handle testing for Bloom-generated code?
- Bloom supports PHPUnit by default. While it doesn’t natively integrate with Pest, you can write custom tests for generated controllers and models. Avoid tight coupling with Bloom’s assertions to maintain test independence.
- What are the performance implications of using Bloom’s admin dashboard?
- Bloom’s dashboard adds overhead due to its pre-built UI components and routes. For high-traffic applications, profile performance and consider caching generated views or optimizing database queries in the admin namespace.
- Are there alternatives to Bloom for Laravel CRUD generation?
- Yes, consider **Laravel Nova**, **Filament**, or **Livewire-based CRUD generators** like Nova or Filament for more flexibility and long-term maintenance. These offer better customization, API-first support, and active community backing.