- Can I use mmucklo/grid-bundle in a vanilla Laravel project without Symfony?
- No, it’s tightly coupled with Symfony’s ecosystem (Doctrine ORM, Twig, Dependency Injection). For Laravel, you’d need to abstract Symfony services (e.g., wrap Doctrine queries in Eloquent or use a bridge like `symfony/dependency-injection`). Consider Laravel-native alternatives like `yajra/laravel-datatables` instead.
- What Laravel versions or hybrid stacks support this bundle?
- It’s designed for Symfony 3.4–8.0, but works in Laravel projects *only if* they already use Symfony components (e.g., Doctrine ORM, Twig). For Lumen or Laravel with Eloquent, integration requires significant refactoring or a custom adapter layer. Test compatibility carefully.
- How do I install this in a Symfony-adjacent Laravel project?
- Run `composer require mmucklo/grid-bundle`, then follow Symfony’s installation steps (e.g., add to `AppKernel.php` for Symfony 2/3 or use recipes for Symfony 4+). For Laravel, manually configure the bundle’s services in `config/app.php` or use a Symfony container bridge like `symfony/dependency-injection`.
- Does this bundle support MongoDB with Laravel?
- Yes, it supports Doctrine MongoDB ODM, but Laravel’s native MongoDB integration (e.g., `jenssegers/mongodb`) won’t work directly. You’d need to use Doctrine ODM alongside Laravel or create a custom adapter to bridge Doctrine queries with Laravel’s MongoDB models.
- Can I render grids with Bootstrap in Laravel?
- Yes, the bundle outputs Bootstrap-friendly HTML tables by default. For Laravel, ensure your Blade templates include Bootstrap CSS/JS, or manually style the rendered HTML. If using DataTables/jqGrid, include their assets via Laravel Mix or CDN.
- How do I customize columns or add actions (e.g., edit/delete buttons) in Laravel?
- Column customization is done via YAML/XML config or annotations (Symfony-specific). For Laravel, you’d need to either: 1) Use Blade directives to render custom columns/actions, or 2) Override the bundle’s Twig templates with Blade equivalents. Actions like edit/delete would require routing to Laravel controllers.
- Will this bundle work with Laravel’s Eloquent ORM?
- No, it’s built for Doctrine ORM/ODM. To use it with Eloquent, you’d need to rewrite the query logic (e.g., replace Doctrine queries with Eloquent queries) or create a data source adapter. Alternatively, use the bundle’s backend logic (filtering/sorting) and render results manually in Blade.
- Are there performance concerns for large datasets in Laravel?
- Yes, server-side processing (e.g., Doctrine queries) can impact performance with large datasets. Optimize by: 1) Using client-side processing in DataTables/jqGrid, 2) Adding database indexes, or 3) Implementing pagination/caching. For Laravel, ensure Eloquent queries are efficient if you adapt the bundle’s logic.
- What are the best alternatives for Laravel if this bundle isn’t a fit?
- For Laravel, consider: `yajra/laravel-datatables` (DataTables integration), `spatie/laravel-data-tables` (server-side processing), or commercial options like Backpack for Laravel (admin panels). These are natively compatible with Eloquent, Blade, and Laravel’s service container.
- How do I handle testing or CI/CD for this bundle in a Laravel project?
- Test the bundle’s backend logic (e.g., query building) with Laravel’s testing tools (PHPUnit/Pest). For frontend rendering, test Blade templates separately. CI/CD pipelines should verify Symfony dependencies (e.g., Doctrine) are compatible with your Laravel stack. Use Docker or isolated environments to avoid conflicts.