Auditing Laravel
summary
Shows a concrete audit implementation: a Singleton audit service collected via middleware and a terminate middleware to capture request/response after send, uses Laravel events (model retrieved, notification sent, mail message sent, gate evaluated) as inputs, measures request time via the LARAVEL_START constant, and persists JSON collections in the database so they cast back to collections. Demo code is runnable and claims it took ~30 minutes to build. Event-driven listeners handle the wiring.
AI-written summary · about
chapters (17)
- 0:00Laravel auditing intro
- 1:13What is auditing
- 4:45Auditing use cases
- 5:06Middleware basics
- 7:51Terminate middleware
- 8:14Custom audit service
- 11:41Registering audit service
- 12:25Data via Laravel events
- 13:51Auditing models
- 15:17Auditing notifications
- 16:41Auditing policies
- 18:31Event listeners
- 19:13Request time in middleware
- 20:15Storing audit data
- 21:41Alternative auditing packages
- 23:08Extending auditing
- 23:49Q&A








