The project im currently working on makes use of Spaties Event Projector package. Recently the team at Spatie upgraded the package to Version 2.
One of the changes that was made was to separate all storable events from regular events by moving them from the
App\Events to a new
App\StorableEvents folder. In moving the new stored events a new namespace of
App\StorableEvents was created.
Whilst this isn’t a mandatory change, all new events classes created get in this new namespace and for the sake of keeping code organised, I wanted to move all of our other storable events to this new folder.
Light work until I wanted to replay my events. What I’d forgotten is that the fully qualified class names are stored on the
stored_events table that the package uses.
No big deal I thought - ill just search for
App\Events\% and replace with
App\StorableEvents\%, how hard could that be in SQL? Turns out harder than I thought but not impossible…