Invoke when working on HTTP error pages in a Nyumbani app: 401, 403, 404, 419, 429, 500 or 503 views, changing their wording or look, adding another status code, disabling them, or testing them. Skip for validation errors and toasts.
php artisan boost:add-skill nyumbani/ui
Save this content to: .claude/skills/nyumbani-error-pages/SKILL.md
# Nyumbani Error Pages
The package ships a lively page for every common error, and every Nyumbani app inherits them. Do not create `resources/views/errors/*.blade.php` in an app unless the page must differ from the standard.
## What ships
`401`, `403`, `404`, `419`, `429`, `500`, `503`, all extending `nyumbani::layouts.error`, which carries the Nyumbani logo, a gradient status code, a small still icon above the heading and the actions (Take me home, Go back, and Try again on the 429, 500 and 503 pages). Go back is a plain link to `url()->previous(url('/'))`, built on the server, so it needs no JavaScript and falls back to the home page. The 419 page has no Try again button.
## How they load
`ViewServiceProvider::handleErrorPages()` appends the package views directory to `config('view.paths')` (Laravel rebuilds the `errors` namespace from it at render time) and calls `View::addLocation()`. An app view in `resources/views/errors/` still wins because it comes first.
Switch them off with `'error_pages' => false` in the published `config/ui.php`.
## Wording
- 404 heading: "Page not found".
- 500 is diplomatic: "Oops, something went wrong". Never blame the user or write "Something broke on our side".
- 503 must use the word maintenance.
- Keep the tone warm and brief, with one clear next action.
## Adding or overriding a page
Extend the layout and fill the sections:
```blade
@extends('nyumbani::layouts.error')
@section('code', '410')
@section('heading', 'Gone for good')
@section('detail', 'This page has been removed.')
@section('icon') ...svg paths... @endsection
@section('actions') ... @endsection
```
Use `@use` for classes and never `@php`.
## Testing
In tests, view the page with `view('errors.404')`. The `errors::` namespace only exists during a real render. Assert real requests with `$this->get('/missing')->assertNotFound()->assertSee('Page not found')`.
The UI docs preview every page at `/nyumbani-ui/docs/error-pages` (local environment only), so there is no need to build a page of your own to see them.
The package ships a lively page for every common error, and every Nyumbani app inherits them. Do not create resources/views/errors/*.blade.php in an app unless the page must differ from the standard.
401, 403, 404, 419, 429, 500, 503, all extending nyumbani::layouts.error, which carries the Nyumbani logo, a gradient status code, a small still icon above the heading and the actions (Take me home, Go back, and Try again on the 429, 500 and 503 pages). Go back is a plain link to url()->previous(url('/')), built on the server, so it needs no JavaScript and falls back to the home page. The 419 page has no Try again button.
ViewServiceProvider::handleErrorPages() appends the package views directory to config('view.paths') (Laravel rebuilds the errors namespace from it at render time) and calls View::addLocation(). An app view in resources/views/errors/ still wins because it comes first.
Switch them off with 'error_pages' => false in the published config/ui.php.
Extend the layout and fill the sections:
@extends('nyumbani::layouts.error')
@section('code', '410')
@section('heading', 'Gone for good')
@section('detail', 'This page has been removed.')
@section('icon') ...svg paths... @endsection
@section('actions') ... @endsection
Use @use for classes and never @php.
In tests, view the page with view('errors.404'). The errors:: namespace only exists during a real render. Assert real requests with $this->get('/missing')->assertNotFound()->assertSee('Page not found').
The UI docs preview every page at /nyumbani-ui/docs/error-pages (local environment only), so there is no need to build a page of your own to see them.
How can I help you explore Laravel packages today?