laravel:exception-handling-and-logging

Exception Handling and Logging

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "laravel:exception-handling-and-logging" with this command: npx skills add jpcaparas/superpowers-laravel/jpcaparas-superpowers-laravel-laravel-exception-handling-and-logging

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);
    }
});

}

Patterns

  • Use domain-specific exceptions for expected error paths

  • Add structured context to logs; avoid logging secrets

  • Route noisy logs to separate channels; keep defaults actionable

  • Convert to API-appropriate responses in renderable()

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

laravel:routes-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
General

laravel:blade-components-and-layouts

No summary provided by upstream source.

Repository SourceNeeds Review
General

laravel:queues-and-horizon

No summary provided by upstream source.

Repository SourceNeeds Review