dmytrof/import-fractal-bundle
Bundle class, Symfony DI, and event system). Laravel’s service container and autoloading differ fundamentally.spatie/laravel-symfony-support) to emulate Symfony bundles. Requires manual mapping of Symfony services to Laravel bindings.Illuminate\Support\Manager for dynamic transformers).EventDispatcher vs. Laravel’s Events system.ServiceProvider/Package model.JsonResource).JsonResource sufficient?league/fractal (via Composer).dmytrof/import-bundle (or a Laravel-compatible alternative like maatwebsite/excel).spatie/laravel-symfony-support (if using Symfony Bridge).ContainerAware, EventSubscriber interfaces) will require adapters.Illuminate\Contracts\Container\BindingResolutionException may surface if Symfony DI is misconfigured.| Step | Action | Laravel-Specific Notes |
|---|---|---|
| 1 | Assess Need | Confirm Fractal’s transformers are required (vs. Laravel’s JsonResource). |
| 2 | Dependency Setup | Install league/fractal and a Laravel import package (e.g., maatwebsite/excel). |
| 3 | Symfony Bridge (Optional) | Install spatie/laravel-symfony-support to emulate bundles. |
| 4 | Bundle Integration | Register DmytrofImportFractalBundle in config/app.php (if using bridge). |
| 5 | Adapter Layer | Create Laravel service providers to map Symfony services (e.g., FractalManager). |
| 6 | Testing | Validate import + transform workflows with real data. |
| 7 | Fallback | If integration fails, replace with custom Fractal + Laravel import logic. |
ContainerInterface ≠ Laravel’s Container. Use spatie/laravel-symfony-support or manual binding.EventDispatcher → Laravel’s Events facade (map listeners manually).config/bundles.php → Laravel’s config/app.php service providers.JsonResource:
| Risk | Impact | Mitigation |
|---|---|---|
| Symfony-Laravel Integration Failure | Runtime errors, app crashes | Use feature flags to disable bundle if unstable. |
| Fractal Transformer Errors | Invalid API responses | Add validation layers before/after transformers. |
| Dependency Conflicts | Composer install failures | Use platform-check in CI to catch version issues. |
| Unmaintained Bundle | Broken in future Symfony/Laravel versions | Fork and maintain internally. |
| Performance Degradation | Slow API responses | Profile with Laravel Debugbar/Xdebug. |
How can I help you explore Laravel packages today?