PHPackages                             vkm-apps/x-error - 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. [Templating &amp; Views](/categories/templating)
4. /
5. vkm-apps/x-error

ActiveLibrary[Templating &amp; Views](/categories/templating)

vkm-apps/x-error
================

A Laravel package providing multilingual error pages.

v1.1.0(6d ago)091↓57.1%MITPHPPHP ^8.1

Since Dec 21Pushed 2w agoCompare

[ Source](https://github.com/vkm-apps/x-error)[ Packagist](https://packagist.org/packages/vkm-apps/x-error)[ Docs](https://github.com/vkm-apps/x-error)[ GitHub Sponsors](https://github.com/vkm-apps)[ RSS](/packages/vkm-apps-x-error/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (5)Versions (12)Used By (0)

X-Error
=======

[](#x-error)

A clean, customizable, and developer-friendly error page system for Laravel.

X-Error replaces Laravel’s default error pages with a polished, fully-responsive UI featuring automatic dark mode, detailed (and secure) exception inspector, and comprehensive localization support — while remaining completely unobtrusive.

---

### 🌐 Available Languages

[](#-available-languages)

X-Error comes pre-translated out-of-the-box for **25 languages**:

- 🇸🇦 **Arabic** (`ar`)
- 🇧🇬 **Bulgarian** (`bg`)
- 🇨🇳 **Chinese** (`zh`)
- 🇩🇰 **Danish** (`da`)
- 🇳🇱 **Dutch** (`nl`)
- 🇺🇸/🇬🇧 **English** (`en`)
- 🇫🇮 **Finnish** (`fi`)
- 🇫🇷 **French** (`fr`)
- 🇩🇪 **German** (`de`)
- 🇬🇷 **Greek** (`el`)
- 🇮🇳 **Hindi** (`hi`)
- 🇮🇩 **Indonesian** (`id`)
- 🇮🇹 **Italian** (`it`)
- 🇯🇵 **Japanese** (`ja`)
- 🇰🇷 **Korean** (`ko`)
- 🇳🇴 **Norwegian Bokmål** (`nb`)
- 🇵🇱 **Polish** (`pl`)
- 🇵🇹 **Portuguese** (`pt`)
- 🇷🇴 **Romanian** (`ro`)
- 🇷🇺 **Russian** (`ru`)
- 🇪🇸 **Spanish** (`es`)
- 🇸🇪 **Swedish** (`sv`)
- 🇹🇷 **Turkish** (`tr`)
- 🇺🇦 **Ukrainian** (`uk`)
- 🇻🇳 **Vietnamese** (`vi`)

---

### 💡 Why X-Error?

[](#-why-x-error)

Laravel is fantastic, but its default error pages can feel plain, hard to translate dynamically, and difficult to customize securely. **X-Error** bridges this gap:

- **Stunning, Responsive UI:** Your users will see a polished, cohesive design (with auto-switching light and dark mode) matching modern web standards instead of generic web pages.
- **Global-First Architecture:** The package automatically detects and translates error titles and messages based on Laravel's active locale.
- **Secure Stack Traces in Production:** Developers often need to see traceback info on staging or production to debug issues quickly. X-Error allows you to enable exception details securely, restricted to authenticated users or specific permission gates (e.g., custom Laravel Gates), while displaying clean, credential-safe minimal info to regular users.
- **Developer-Friendly &amp; Unobtrusive:**
    - Standard debuggers (like Ignition) are fully preserved in `local` development or when `app.debug` is enabled.
    - API and JSON requests automatically bypass X-Error, letting Laravel handle API error responses natively.
- **Total Customization:** Map unique theme colors to specific HTTP status codes, configure redirect actions, or bring your own template utilizing the `` Blade component.

---

📋 Requirements
--------------

[](#-requirements)

- **PHP:** `^8.1`
- **Laravel (illuminate/support):** `^10.0 | ^11.0 | ^12.0 | ^13.0`

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require vkm-apps/x-error
```

Laravel will automatically discover and register the service provider.

⚙️ Publishing Assets
--------------------

[](#️-publishing-assets)

You may publish the package resources as needed.

Publish Configuration

```
php artisan vendor:publish --tag="x-error-config"
```

Publish Views (optional)

```
php artisan vendor:publish --tag="x-error-views"
```

Publish Translations (optional)

```
php artisan vendor:publish --tag="x-error-lang"
```

🧠 How It Works
--------------

[](#-how-it-works)

The package registers a custom exception handler that renders error pages using the `x-error` views.

During rendering, the following data is passed to the error view:

```
return response()->view($view, [
    'code'      => $code,
    'title'     => __("x-error::errors.$code.title"),
    'message'   => __("x-error::errors.$code.message"),
    'color'     => $color,
    'exception' => $exception,
]);
```

These variables are always available — including when using your own custom layout.

🧩 Blade Component
-----------------

[](#-blade-component)

The package registers a reusable component that is automatically available in all views:

```

```

### Component Props &amp; Slots

[](#component-props--slots)

You can customize the `` component with the following properties:

Prop / SlotTypeDescription`code``string/int`The HTTP status code (e.g. `404`, `500`).`title``string`The error title.`message``string`The error description message.`color``string`CSS class for text color (e.g. `text-red-500`).`exception``Throwable/string`Exception stack trace to display inside the accordion.`logo``Slot`Custom slot to place a logo/brand image at the top.`button``Slot`Custom slot to override the redirect button.Default Slot`Slot`Any custom HTML to append below the error message.#### Component Example with Slots

[](#component-example-with-slots)

```

                Go to Dashboard

    If you believe this is an error, please contact support.

```

🎨 Configuration
---------------

[](#-configuration)

The configuration file is published at `config/x-error.php`.

### Layout

[](#layout)

You may define a custom layout view. If set, you must manually include the `` component in your layout file.

```
'layout' => 'errors.custom', // Set to null to use default package layout
```

### Exception Details

[](#exception-details)

Control visibility of exception stack traces.

```
'exception' => [
    'enabled' => false, // Set to true to enable stack trace outputs
    'title' => 'Exception Details',
    'permission' => null, // Permission required to view exceptions (null = all authenticated users)
],
```

- **enabled:** Enable or disable exception trace outputs.
- **title:** Title shown above the trace accordion.
- **permission:** An authorization Gate or Permission required to view exceptions. If `null`, all authenticated users can view details.

### Colors

[](#colors)

Define colors mapped to HTTP status codes (Tailwind CSS classes recommended).

```
'colors' => [
    '404' => 'text-blue-600 dark:text-blue-400',
    '500' => 'text-red-600 dark:text-red-400',
    'default' => 'text-zinc-600 dark:text-white',
],
```

### Redirect Button

[](#redirect-button)

A redirect button shown on all error pages (except status code 503).

```
'button' => [
    'url' => '/', // Set to null to hide the button
    'class' => 'px-20 py-2 border border-zinc-400 dark:border-zinc-500 rounded-md ...',
    'text' => 'Home',
],
```

🌍 Localization
--------------

[](#-localization)

Error titles and messages are fully translatable. The package resolves translations using:

```
__("x-error::errors.{code}.title")
__("x-error::errors.{code}.message")
```

Example Translation File Structure (`lang/vendor/x-error/{locale}/errors.php`):

```
return [
    '404' => [
        'title' => 'Page Not Found',
        'message' => 'The page you are looking for does not exist.',
    ],
];
```

> Translations can be published using the `--tag="x-error-lang"` flag and customized as needed.

🧪 Custom Layout Example
-----------------------

[](#-custom-layout-example)

If you define a custom layout view in `config/x-error.php` (e.g. `layout => 'errors.custom'`), your layout file (`resources/views/errors/custom.blade.php`) should include the component to render the details:

```
>

    {{ $title }}

```

> All values are automatically injected by the exception handler into your custom view.

🛡 Best Practices
----------------

[](#-best-practices)

- **Security First:** Enable exception details (`exception.enabled => true`) only in `local`/`staging` environments or restrict them with a robust `permission` check in production.
- **Keep it Clean:** Avoid over-styling error states so critical status information remains easy to read.
- **Localization:** Always check if your supported application locales exist in the package or publish the translations to add them.

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

⭐ Credits
---------

[](#-credits)

Created with ❤️ for the Laravel community.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance98

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~18 days

Recently: every ~7 days

Total

11

Last Release

6d ago

### Community

Maintainers

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

---

Top Contributors

[![vkm-apps](https://avatars.githubusercontent.com/u/139857686?v=4)](https://github.com/vkm-apps "vkm-apps (13 commits)")

---

Tags

laravellocalizationi18nmultilinguallaravel-packagebladecomponentfrontenderror-pagesBlade componenthttp errors

### Embed Badge

![Health badge](/badges/vkm-apps-x-error/health.svg)

```
[![Health](https://phpackages.com/badges/vkm-apps-x-error/health.svg)](https://phpackages.com/packages/vkm-apps-x-error)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18421.4k11](/packages/technikermathe-blade-lucide-icons)[mati365/ckeditor5-livewire

CKEditor 5 integration for Laravel Livewire

447.9k](/packages/mati365-ckeditor5-livewire)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2464.9k6](/packages/hasinhayder-tyro-login)

PHPackages © 2026

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