laravel:exception-handling-and-logging

Installation
SKILL.md

Exception Handling and Logging

Treat errors as first-class signals; provide context and paths to remediation.

Commands

// app/Exceptions/Handler.php
public function register(): void
{
    $this->reportable(function (DomainException $e) {
        Log::warning('domain exception', ['code' => $e->getCode()]);
    });

    $this->renderable(function (ModelNotFoundException $e, $request) {
        if ($request->expectsJson()) {
            return response()->json(['message' => 'Not Found'], 404);
        }
    });
Related skills
Installs
66
GitHub Stars
131
First Seen
Jan 21, 2026