bengor-user/simple-bus-bridge-bundle
symfony/dependency-injection, symfony/http-kernel) or a Laravel-Symfony bridge (e.g., laravel-symfony-bundle).UserBundle integration) would need manual adaptation for Laravel’s Auth system.| Risk Area | Assessment |
|---|---|
| Deprecation Risk | Last release in 2017; no dependents or activity. High risk of breaking changes with newer Symfony/Laravel versions. |
| Symfony Dependency | Heavy reliance on Symfony components (e.g., UserBundle, EventDispatcher). Laravel’s Auth system differs significantly, requiring custom adapters or refactoring. |
| Testing Gaps | Tests use PHPSpec (BDD), but no Laravel-specific tests. Integration risks in Laravel’s service container, event system, or auth lifecycle. |
| Event Schema Mismatch | SimpleBus expects strict event contracts; Laravel’s Auth events (e.g., Registered, LoggedIn) may not align with SimpleBus’s command/query patterns. Manual mapping required. |
| Performance Overhead | Symfony’s EventDispatcher + SimpleBus adds indirection. In Laravel, direct queue jobs (e.g., Illuminate\Queue) may be simpler for async workflows. |
Why SimpleBus?
Symfony vs. Laravel Tradeoffs
spatie/laravel-simple-bus) preferable?Migration Path
Auth::login) be mapped to SimpleBus commands?Long-Term Viability
| Component | Laravel Compatibility |
|---|---|
| SimpleBusBridgeBundle | ❌ Not natively compatible. Requires: |
| - Symfony Kernel (e.g., via Lumen or Symfony Standalone). | |
| - Laravel-Symfony Bridge (e.g., laravel-symfony-bundle) to share DI containers. | |
| SimpleBus (Core) | ✅ Compatible via: |
| - simple-bus/simple-bus (standalone PHP). | |
| - spatie/laravel-simple-bus (Laravel wrapper). | |
| UserBundle | ❌ Incompatible. Laravel’s Auth system differs. Options: |
- Replace with Laravel’s Illuminate\Auth and manually emit SimpleBus events. |
|
- Use Symfony’s UserBundle in a separate service (e.g., Lumen API) that Laravel calls. |
Assess Event Needs
CreateUserCommand, UserRegisteredEvent).Option 1: Hybrid Symfony-Laravel (High Risk)
SimpleBusBridgeBundle.Option 2: Pure Laravel (Recommended)
UserBundle with Laravel’s Auth.// Example: Using spatie/laravel-simple-bus
use Spatie\SimpleBus\Commands\Bus;
use Spatie\SimpleBus\Commands\Command;
class RegisterUserCommand implements Command {
public function handle() {
// Business logic
}
}
// Emit from Laravel Auth listener:
Auth::attempt([...])->then(function () {
Bus::dispatch(new RegisterUserCommand());
});
Option 3: Fork & Adapt (Medium Risk)
UserBundle dependencies to use Laravel’s Auth.UserBundle\Event\UserEvent with Illuminate\Auth\Events\Registered.| Laravel Feature | Compatibility Notes |
|---|---|
| Service Container | SimpleBusBridgeBundle uses Symfony’s DI. Laravel’s container is incompatible without a bridge (e.g., laravel-symfony-bundle). |
| Event System | Laravel’s Event system differs from Symfony’s EventDispatcher. Manual mapping required for UserBundle events. |
| Auth System | UserBundle’s User entity is not compatible with Laravel’s Illuminate\Auth\User. Custom adapters needed. |
| Queue Workers | SimpleBus uses message queues (e.g., RabbitMQ, Redis). Laravel’s Illuminate\Queue can interoperate if configured similarly. |
| PHP 8.x Support | Bundle requires PHP 5.5+ but has no PHP 8.x tests. May need dependency updates (e.g., Symfony 6.x). |
Phase 1: Proof of Concept (2-4 weeks)
spatie/laravel-simple-bus).Phase 2: Bundle Adaptation (4-8 weeks)
How can I help you explore Laravel packages today?