The World of Laravel Exceptions
summary
Concrete Laravel techniques for structuring exceptions: create custom exception classes that implement an interface so you can catch by type, attach contextual arrays for richer logging, and route reports to Sentry or other providers via the Exception Handler’s report/render methods. Shows how to render responses or redirects, disable debug leaks in production, use the global rescue helper as a concise try/catch, and explains that queued job exceptions bypass the HTTP handler so jobs must handle failures themselves; includes practical code snippets and config locations.
AI-written summary · about
chapters (22)
- 0:00Laravel exceptions intro
- 1:42Base exception class
- 3:07User registration exceptions
- 5:57Custom exception classes
- 7:26Extending exception handler
- 8:52Exception reporting
- 10:39Rendering exceptions
- 13:10Production exceptions
- 14:18Custom reporting callbacks
- 16:03Stopping reporting chains
- 16:44Context data in reporting
- 18:08JSON responses for exceptions
- 19:13Custom exception responses
- 20:35Create custom exception
- 22:00Exception properties/methods
- 23:04Report method details
- 23:47Custom 404 pages
- 25:11Board-level handling
- 26:15Rescue method
- 27:19Job queue exceptions
- 28:42Job process exceptions
- 29:04Conclusion
related talks
35mHandling Exceptional Conditions with Grace and Elegance
54mState of Laravel
42mCustomizing Laravel
38mLaravel Design Patterns
51mLeveraging Typed Exceptions for Cleaner Error Handling
31mModern PHP development with Laravel 5.6
31mException design - the art of making debugging more accurate
51mExceptions in PHP: more complicated than it appears
