Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Event Sourcing Laravel Package

spatie/laravel-event-sourcing

Event sourcing toolkit for Laravel: build aggregates, projectors, and reactors to store state changes as events. Ideal for audit trails, decisions based on history, and future reporting needs. Includes docs, examples, and an optional course.

View on GitHub
Deep Wiki
Context7

title: Handling exceptions weight: 4

The event-sourcing config file has a key, catch_exceptions, that determines what will happen should a projector or reactor throw an exception. If this setting is set to false, exceptions will not be caught and your app will come to a grinding halt.

If catch_exceptions is set to true, and a projector or reactor throws an exception, all other projectors and reactors will still get called. The Projectionist will catch all exceptions and fire the EventHandlerFailedHandlingEvent. That event contains these public properties:

  • eventHandler: The projector or reactor that could not handle the event.
  • storedEvent: The instance of Spatie\EventSourcing\Models\StoredEvent that could not be handled.
  • exception: The exception thrown by the EventHandler.

It will also call the handleException method on the projector or reactor that threw the exception. It will receive the thrown error as the first argument. If you throw an exception in handleException, the Projectionist will not catch it and your php process will fail.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport