- How do I integrate EMS SubmissionBundle with Laravel if I’m not using EMS FormBundle?
- Use middleware to intercept form submissions (e.g., POST /submit) and pass the data to the bundle’s processors. Alternatively, create a Laravel facade (e.g., `Submission::handle($data)`) to abstract the bundle’s logic. For Laravel-native forms, leverage `FormRequest` classes to prep data before submission.
- Does EMS SubmissionBundle work with Laravel’s Eloquent ORM or Laravel Queues?
- The bundle primarily uses Doctrine for database interactions, but you can extend its configuration to integrate with Eloquent by creating custom processors. For queues, use Laravel’s native queue system by wrapping the bundle’s logic in a job or leveraging `fruitcake/laravel-queue-symfony` for Symfony Messenger compatibility.
- What Laravel versions does EMS SubmissionBundle support?
- The bundle is built for Laravel 10.x and relies on Symfony 6.x components. While no official Laravel roadmap exists, it’s actively maintained (last release: 2026-06-01). Test compatibility thoroughly, especially if using Laravel’s newer features like model observers or first-party validation.
- Can I use EMS SubmissionBundle for real-time form processing or multi-step workflows?
- The bundle excels at structured data ingestion (e.g., surveys) but lacks built-in support for real-time processing or complex workflows. For multi-step forms, implement custom processors or chain Symfony’s `CommandBus` with Laravel’s queues. Consider alternatives like `spatie/laravel-form-builder` if advanced routing is needed.
- How do I configure submission targets (e.g., database, API) in Laravel?
- Define targets in YAML/JSON config files (e.g., `config/ems_submission.yaml`) using the bundle’s schema. For Laravel-specific needs, extend the config with PHP arrays or create custom processors. Example: Add a `database` target with Eloquent model bindings or an `api` target with Guzzle HTTP client logic.
- Will EMS SubmissionBundle conflict with Laravel’s native request handling?
- Potential conflicts arise from Symfony’s `HttpFoundation` component. Mitigate this by namespacing services in Laravel’s container or using `spatie/laravel-symfony-support` for seamless integration. Test request lifecycle hooks (e.g., middleware, middleware groups) to ensure compatibility with Laravel’s routing.
- How do I bridge Symfony events to Laravel’s event system?
- Use `symfony/event-dispatcher` alongside Laravel’s `Illuminate/Events` by creating a custom event dispatcher that translates between the two. For example, dispatch a Laravel event in a Symfony event listener or vice versa. Performance overhead is minimal if using Laravel’s queue-based event system for async processing.
- What’s the best way to handle submission failures (e.g., retries, dead-letter queues)?
- Extend the bundle’s configuration to include retry logic via Laravel’s queue system or Symfony’s `Messenger` component. For dead-letter queues, implement a custom processor that logs failed submissions to a table or external service (e.g., Sentry). Test failure scenarios with malformed data or API timeouts.
- Are there alternatives to EMS SubmissionBundle for Laravel form submissions?
- For lightweight submissions, consider `spatie/laravel-form-builder` or `laravelcollective/html`. For event-driven workflows, pair Laravel’s `FormRequest` with `spatie/laravel-activitylog` or `spatie/laravel-medialibrary` for file uploads. If you need Symfony integration, `spatie/laravel-symfony-support` can help bridge components without full bundle adoption.
- How do I test EMS SubmissionBundle in a Laravel project?
- Mock Symfony services (e.g., `HttpFoundation`, `EventDispatcher`) using Laravel’s `Mockery` or PHPUnit’s `createMock()`. Test submission workflows by simulating form data and verifying targets (e.g., database inserts, API calls). Use Laravel’s `HttpTests` trait to validate routes and middleware interactions. Focus on edge cases like invalid data or failed external calls.