0042-laravel-exceptions

Community

Throw HTTP-ready exceptions with clear factories

AuthorMrJmpl3
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It helps you standardize Laravel exception handling by making business-rule errors easy to throw with consistent HTTP status codes and descriptive messages.

Core Features & Use Cases

  • Static factory methods for creating specific exception variants (for example, not found, cannot cancel, insufficient stock, payment failure).
  • HTTP status code coupling by returning exceptions with the correct response code directly in the factory.
  • HttpExceptionInterface compatibility (via an Httpable concern) so exceptions can be automatically translated into HTTP responses.

Use Case: When an action validates an Order state (pending, cancelable, has items) you can throw a tailored OrderException that surfaces the right status code and message without duplicating logic across controllers/services.

Quick Start

Ask the AI to show how to use OrderException::notFound($orderId) inside an action to return a 404 with a clear message.

Dependency Matrix

Required Modules

None required

Components

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: 0042-laravel-exceptions
Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0042-laravel-exceptions

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.