laravel-exceptions
CommunityElegant Laravel exceptions for precise errors.
Software Engineering#php#exceptions#laravel#HttpExceptionInterface#static-factories#http-exceptions#httpable
Authornextplus896
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Custom exceptions with static factories and HTTP responses standardize error handling in Laravel applications, enabling consistent, contextual error reporting.
Core Features & Use Cases
- Static factory methods for common error scenarios (e.g., notFound, cannotCancelOrder) to express domain-specific failures.
- Implement HttpExceptionInterface and use the Httpable trait to generate HTTP-aware error responses.
- Descriptive, context-rich messages that map to appropriate HTTP status codes for better client feedback.
Quick Start
Define a new exception class (e.g., OrderException) extending Exception, implementing HttpExceptionInterface and using the Httpable trait. Add static factories like notFound($id) and cannotCancelOrder($order), then throw the exception in controllers or actions to return proper HTTP responses.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: laravel-exceptions Download link: https://github.com/nextplus896/durra-alaseel/archive/main.zip#laravel-exceptions Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.