arnedesmedt/api-platform-event-engine-bundle
AggregateRoot) and commands (via AggregateCommand), which enforces bounded context boundaries and reduces accidental coupling between API endpoints and business logic.JsonSchemaAwareRecord) for both commands and state, ensuring machine-readable contracts between API Platform and Event Engine. This is valuable for API-first and microservices architectures where schema validation is critical.arnedesmedt/event-engine-symfony-bundle (v0.8.0), which may introduce vendor lock-in or maintenance overhead if the upstream bundle evolves.Bundle system, ContainerInterface) in Laravel.Messenger/EventDispatcher. Mapping API Platform operations to Event Engine commands would need custom middleware or listeners.Illuminate\Support\Collection), while this bundle relies on team-blue/php-json-immutable-objects. Potential serialization mismatches could arise.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| API Platform Version | High | Pin to exact versions of api-platform/core to avoid breaking changes. |
| Symfony Dependency | High | Abstract Symfony-specific components (e.g., ContainerInterface) behind interfaces. |
| Event Engine Maturity | Medium | Evaluate event-engine-symfony-bundle’s long-term viability and community support. |
| Schema Rigidity | Medium | Ensure JSON Schema definitions are versioned and backward-compatible. |
| Performance Overhead | Low | Benchmark command/aggregate processing latency under load. |
| Debugging Complexity | Medium | Implement structured logging for event-command mappings and aggregate state. |
Why Event Engine?
laravel-echo, spatie/laravel-event-sourcing)?Laravel Adaptation Effort
Bundle system be replaced in Laravel? (e.g., via service providers, package wrappers)spatie/laravel-cqrs) that could achieve similar goals with less friction?Aggregate Design
Operation Mapping
POST /orders, PATCH /orders/{id}) be explicitly mapped to Event Engine commands?Error Handling & Rollback
Testing Strategy
Long-Term Maintenance
event-engine-symfony-bundle) evolve?| Component | Laravel Equivalent/Alternative | Compatibility Notes |
|---|---|---|
| API Platform | api-platform/core (Laravel bridge exists) |
Use api-platform/laravel for Laravel integration. |
| Event Engine | arnedesmedt/event-engine-symfony-bundle |
No direct Laravel port; requires abstraction layer (e.g., custom service container bindings). |
| Messenger | Laravel’s Illuminate\Bus or Laravel\Horizon |
Event Engine commands may need to be adapted to Laravel queues. |
| JSON Schema | spatie/laravel-json-schema or zircote/swagger-php |
Ensure schema validation aligns between API Platform and Event Engine. |
| Aggregate Root | Laravel models + spatie/laravel-event-sourcing |
Could replace with Laravel’s native event system if Event Engine is overkill. |
| Command Bus | laravel-zero/framework or custom middleware |
API Platform operations would dispatch commands via Laravel middleware or API resource hooks. |
Assessment Phase
Proof of Concept (PoC)
Order) with:
Abstraction Layer
event-engine-symfony-bundle:
Bundle with a service provider.ContainerInterface to Laravel’s Illuminate\Container.// app/Providers/EventEngineServiceProvider.php
public function register()
{
$this->app->singleton(EventEngine::class, function ($app) {
return new EventEngine(
$app->make(CommandBus::class), // Laravel queue-based
$app->make(Store::class) // Custom store adapter
);
});
}
Incremental Rollout
Fallback Strategy
spatie/laravel-cqrs or laravel-echo for simpler event-driven needs.| Concern | Solution |
|---|---|
| Symfony vs. Laravel DI | Use Laravel’s bind() method to resolve Symfony interfaces. |
| Messenger vs. Queues | Route Event Engine commands to Laravel’s dispatch() or Bus::dispatch(). |
| API Platform Operations | Use API Platform’s ApiResource hooks (e.g., postPersist, postUpdate) to trigger commands. |
| JSON Schema Validation | Reuse api-platform/core’s schema definitions or sync with Event Engine’s schemas. |
| Testing | Mock EventEngine interface or use Laravel’s MocksWithinGroups for integration tests. |
api-platform/laravel and `arnedesmedt/event-engineHow can I help you explore Laravel packages today?