- Can I use 21torr/task-manager in Laravel without Symfony Messenger?
- No, this package requires Symfony Messenger as a dependency. You’ll need to install `symfony/messenger` and configure transports (e.g., Redis, Doctrine) to match Laravel’s queue drivers. Laravel’s native queues won’t work directly, but you can bridge them via adapters or decorators.
- How do I migrate existing Laravel jobs to use this bundle’s Task base class?
- Extend the bundle’s `Task` base class for new jobs, but existing Laravel jobs (e.g., `ShouldQueue`) won’t auto-convert. Use traits or decorators to wrap them, or refactor incrementally. The bundle’s `v3.x` enforces this structure, so plan for breaking changes if upgrading.
- Does this bundle support Laravel’s job middleware or queue connections?
- No, the bundle lacks native support for Laravel’s job middleware or `queue:connection` configurations. You’d need to manually map middleware to Symfony Messenger middleware or create custom adapters to bridge the gap.
- Will this bundle work with Laravel 10 (PHP 8.2) or do I need PHP 8.5+?
- The bundle requires PHP 8.5+, which means it won’t work with Laravel 10 (PHP 8.2) or earlier. For Laravel 11+, it’s compatible, but you may need a fork or compatibility layer for older versions.
- How does task logging (TaskLog) integrate with Laravel’s FailedJob table?
- The bundle’s `TaskLog` stores execution history separately from Laravel’s `failed_jobs` table. You’ll need to sync them manually or build a listener to avoid duplicates. Consider extending the bundle’s logging or using Laravel’s event system to cross-reference failures.
- Can I use Eloquent instead of Doctrine ORM for TaskLog?
- The bundle assumes Doctrine ORM, but you can create Eloquent models to mirror its schema (e.g., `TaskLog`, `Task`). This requires custom logic to translate Doctrine entities to Eloquent, adding maintenance overhead.
- What’s the performance impact of TaskLog database writes for every task?
- Each task triggers a `TaskLog` write, which adds database I/O. For high-throughput queues, this could slow performance compared to Laravel’s native queues. Benchmark with your workload—consider batching logs or async writes if latency is critical.
- Does this bundle replace Laravel Horizon or work alongside it?
- It can work alongside Horizon since both use Symfony Messenger under the hood. However, Horizon’s CLI tools (`horizon:work`) won’t manage the bundle’s tasks directly. You’d need to use the bundle’s commands (`task-manager:run-worker`) or integrate them into Horizon’s workflow.
- How do I handle retries or timeouts in Laravel jobs with this bundle?
- The bundle supports retries via `DispatchAfterRunTask` stamps, but Laravel’s `maxAttempts` or `timeout` won’t auto-sync. Map Laravel’s retry logic to the bundle’s stamps manually or build a decorator to unify both systems.
- Are there alternatives to this bundle for Laravel task management?
- For Laravel, consider native queues with `ShouldQueue`, Spatie’s `laravel-queue-scheduler`, or `spatie/laravel-activitylog` for auditing. If you need Symfony Messenger features, `symfony/messenger` alone (without the wrapper) offers more flexibility but requires manual setup.