PHPackages                             next-tecnology/nova-custom-errors - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. next-tecnology/nova-custom-errors

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

next-tecnology/nova-custom-errors
=================================

Custom error views for Nova

0.0.3(7mo ago)086MITBladePHP ^8.2|^8.3|^8.4

Since Nov 20Pushed 7mo agoCompare

[ Source](https://github.com/next-tecnology/nova-custom-errors)[ Packagist](https://packagist.org/packages/next-tecnology/nova-custom-errors)[ RSS](/packages/next-tecnology-nova-custom-errors/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Nova Custom Errors
==================

[](#nova-custom-errors)

Custom error pages for Laravel Nova, provided as a small middleware package.

- Package: `next-tecnology/nova-custom-errors`
- PHP: ^8.2 | ^8.3 | ^8.4
- Nova: ^4.0 | ^5.0

1) Install
----------

[](#1-install)

```
composer require next-tecnology/nova-custom-errors
```

The service provider is auto-discovered via Composer; no manual registration is needed.

2) Add the middleware to Nova
-----------------------------

[](#2-add-the-middleware-to-nova)

Edit `config/nova.php` and add the middleware to Nova's middleware stack. Place it after the standard Nova middleware so it can intercept responses and render the appropriate error views.

```
// config/nova.php
return [
    // ...
    'middleware' => [
        'web',
       .....
        \NextTecnology\NovaCustomErrors\Http\Middleware\HandleNovaErrors::class,
        .....
    ],
    // ...
];
```

That’s it. The middleware will check the response status code and, if it is greater than 400, attempt to render a matching view from this package.

3) Customizing the error views (optional)
-----------------------------------------

[](#3-customizing-the-error-views-optional)

By default, the package ships with views that are used immediately without any publishing. If you want to customize them, publish the views to your application and edit them as needed:

```
php artisan vendor:publish \
  --provider="NextTecnology\\NovaCustomErrors\\NovaCustomErrorsServiceProvider" \
  --tag="nova-custom-errors-views"
```

This will copy the views to:

```
resources/views/vendor/nova-custom-errors/

```

Available default views in the package:

- `401.blade.php`
- `402.blade.php`
- `403.blade.php`
- `404.blade.php`
- `419.blade.php`
- `429.blade.php`
- `500.blade.php`
- `503.blade.php`

The middleware looks up views by status code using the namespace `nova-custom-errors::`. For example, a 404 response will try to render `nova-custom-errors::404` (or your published override at `resources/views/vendor/nova-custom-errors/404.blade.php`).

How it works
------------

[](#how-it-works)

The middleware `HandleNovaErrors` inspects the response returned by Nova and, for status codes &gt; 400, tries to render a view named after that status code:

```
$view = 'nova-custom-errors::' . $response->getStatusCode();
if (view()->exists($view)) {
    return response()->view($view);
}
```

If no matching view exists, the original response is returned unchanged.

Verifying
---------

[](#verifying)

- Trigger a known error within Nova (e.g., visit a non-existent Nova resource) and you should see the corresponding custom error page.
- If you customized views, ensure your edited versions appear under `resources/views/vendor/nova-custom-errors/`.

Troubleshooting
---------------

[](#troubleshooting)

- "Class not found" for the middleware: run `composer dump-autoload` and ensure the fully-qualified class name is correct: `\\NextTecnology\\NovaCustomErrors\\Http\\Middleware\\HandleNovaErrors::class`.
- View not found: ensure the view exists in the package (it does by default), or, if you published views, confirm they are under `resources/views/vendor/nova-custom-errors/` with the correct filename (e.g., `404.blade.php`).
- Config cache: after changing `config/nova.php`, run `php artisan config:clear`.

License
-------

[](#license)

MIT

Note about assets in the minimal layout
---------------------------------------

[](#note-about-assets-in-the-minimal-layout)

The bundled minimal layout view (`resources/views/vendor/nova-custom-errors/minimal.blade.php` after publishing, or the package view `resources/views/minimal.blade.php`) includes this line:

```
@vite(['resources/css/app.css', 'resources/js/app.js'])
```

This expects Laravel Vite to build your assets into `public/build` (the default). If those files are not available in your project, you have two options:

1. Provide the assets via Vite (recommended)

- Install dependencies and build once for production: ```
    npm install
    npm run build
    ```

    This will produce the `public/build` directory and the `@vite` directive will work.
- Or run the Vite dev server during local development: ```
    npm run dev
    ```

    Ensure your app is configured to connect to the Vite dev server as usual for your Laravel version.

2. Customize the layout to fit your asset pipeline

- Publish the views if you haven’t already: ```
    php artisan vendor:publish \
      --provider="NextTecnology\\NovaCustomErrors\\NovaCustomErrorsServiceProvider" \
      --tag="nova-custom-errors-views"
    ```
- Then edit `resources/views/vendor/nova-custom-errors/minimal.blade.php` and either remove the `@vite(...)` line or replace it with whatever your project uses (CDN, compiled static files, Mix, etc.). For example: ```

    ```

If your project doesn’t need any custom CSS/JS for these error pages, you can safely remove the `@vite([...])` line.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance64

Regular maintenance activity

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

215d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf7492101ea7f0b124dfb100ef913b3d89f1a0e25667a2083eb3d2bfec829a61?d=identicon)[NextTecnology](/maintainers/NextTecnology)

---

Top Contributors

[![Elshaden](https://avatars.githubusercontent.com/u/33955172?v=4)](https://github.com/Elshaden "Elshaden (2 commits)")[![next-ly](https://avatars.githubusercontent.com/u/217916840?v=4)](https://github.com/next-ly "next-ly (2 commits)")

---

Tags

laravelerrorsnovaerror-pagescustom-errors

### Embed Badge

![Health badge](/badges/next-tecnology-nova-custom-errors/health.svg)

```
[![Health](https://phpackages.com/badges/next-tecnology-nova-custom-errors/health.svg)](https://phpackages.com/packages/next-tecnology-nova-custom-errors)
```

###  Alternatives

[ebess/advanced-nova-media-library

Laravel Nova tools for managing the Spatie media library.

6143.5M22](/packages/ebess-advanced-nova-media-library)[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2852.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2852.0M9](/packages/outl1ne-nova-sortable)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57239.7k](/packages/sbine-route-viewer)[mostafaznv/nova-map-field

Map Field for Laravel Nova

46101.8k](/packages/mostafaznv-nova-map-field)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
