Event Replay for Local Development #57216
-
Problem Proposed Solution
php artisan event:replay App\\Events\\UserRegistered --since=1h
php artisan event:replay App\\Events\\OrderPlaced --id=123 Benefits
This would make Laravel development more productive, especially for event-heavy applications |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can actually implement this idea today in Laravel without waiting for a core feature, using a lightweight local-only setup. Here's a clean approach that gives you the same benefits you're proposing: ✅ 1) Log dispatched events only in the local environment In your EventServiceProvider (or a dedicate service provider), you can listen to all events and store them in a JSON log:
This avoids any overhead in production |
Beta Was this translation helpful? Give feedback.
You can actually implement this idea today in Laravel without waiting for a core feature, using a lightweight local-only setup. Here's a clean approach that gives you the same benefits you're proposing:
✅ 1) Log dispatched events only in the local environment
In your EventServiceProvider (or a dedicate service provider), you can listen to all events and store them in a JSON log: