hirethunk/verbs
Verbs is a Laravel-friendly event sourcing package for PHP artisans that keeps the benefits of event sourcing while cutting boilerplate and jargon. Model behavior as verbs, record events, and build projections with a clean, approachable API.
verb() helper and macroable pending events reduce coupling with Laravel’s service container.verb_events, verb_snapshots, verb_states), which can coexist with existing Laravel migrations. The package provides artisan commands for schema generation, but manual adjustments may be needed for complex schemas (e.g., multi-tenant setups).Event::dispatch()) and custom listeners, but requires explicit configuration for cross-cutting concerns (e.g., logging, analytics). The fire() method’s replay safety is a standout feature for auditability.State, PendingEvent, Verb), which may require team upskilling. The documentation is strong, but complex domains (e.g., financial systems) will need custom validation logic.last_event_id, but distributed transactions (e.g., across microservices) require additional coordination (e.g., sagas).Illuminate\Database\Eloquent\Model.livewire:commit.dispatch().spatie/array-to-object).id_type config.php artisan verbs:install to generate tables.verb() calls.// Before (ORM)
$order->update(['status' => 'shipped']);
// After (Verbs)
verb()->ship($order->id);
PendingEvent and verify state transitions.Verbs::replay().Verb, State classes).verbs:make:verb, verbs:make:state) streamline generation.Verbs::debug() to inspect state transitions.laravel-verbs, event-sourcing.last_event_id checks.Serializable or use #[Serializable].verb:replay works as expected.VERBS_LOG=1 for verbose output.user_id).Verbs::batch() for bulk operations.How can I help you explore Laravel packages today?