laravel-event-sourcing
laravel-event-sourcing copied to clipboard
Deprecation notice: $firedFromAggregateRoot is deprecated
Using PHP 8.2, I am getting this deprecation notice, if I set 'dispatch_events_from_aggregate_roots' => true,
:
DEPRECATED Creation of dynamic property ... $firedFromAggregateRoot is deprecated in vendor/spatie/laravel-event-sourcing/src/StoredEvents/StoredEvent.php on line 68.
Should be possible to allow dynamic props or define them?
Hmm I'm not sure we can do this without a breaking change, so might have to live with it until our next major version… The warning is annoying but everything still works until PHP 9 when dynamic properties will be removed entirely.
If anyone has an idea how we can work around this in a non-breaking way, ideas welcome!
@sebastiandedeyne can this not be solved using an #[\AllowDynamicProperties]
attribute?