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 and a reusable &lt;x-error&gt; Blade component.

v1.0.3(3mo ago)025↓50%MITPHPPHP ^8.1

Since Dec 21Pushed 3mo agoCompare

[ Source](https://github.com/vkm-apps/x-error)[ Packagist](https://packagist.org/packages/vkm-apps/x-error)[ RSS](/packages/vkm-apps-x-error/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)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 UI, optional exception details, and full localization support — while remaining simple and unobtrusive. The default layout is using Tailwind classes.

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

[](#-installation)

Install the package via Composer:

```
 composer require vkmapps/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,
    ], $code);
```

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

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

[](#-blade-component)

The package registers the following Blade component:

```

```

This component is automatically available in all views.

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

[](#-configuration)

The configuration file is located at:

```
config/x-error.php
```

### Layout

[](#layout)

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

```
'layout' => null,
```

Example:

```
'layout' => 'errors.custom',
```

### Exception Details

[](#exception-details)

Control visibility of exception stack traces.

```
'exception' => [
    'enabled' => false,
    'title' => 'Exception Details',
    'permission' => null,
],
```

**enabled** – Enable or disable exception output **title** – Title shown above exception details **permission** – Permission required to view exceptions (`null` = all authenticated users)

### Colors

[](#colors)

By default, all error pages use a neutral color:

```
'colors' => [
    'default' => 'text-zinc-600 dark:text-white',
],
```

You may optionally define colors per HTTP status code, but this is not required.

### Redirect Button

[](#redirect-button)

A redirect button is shown on all error pages except 503.

```
    'button' => [
    'url' => '/',
    'class' => '...',
    'text' => 'Home',
],
```

> Set url to null to hide the button

🌍 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

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

> Translations can be published and overridden as needed.

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

[](#-custom-layout-example)

If you use your own layout, include the component manually or just use your own layout and error styling:

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

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

[](#-best-practices)

- Enable exception details only in local or staging
- Keep production error pages minimal
- Use translations for all user-facing text
- Avoid over-styling error states

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the MIT license.

❤️ Contributing
---------------

[](#️-contributing)

Contributions are welcome! Fork the repository Create a feature branch

Submit a pull request

⭐ Credits
---------

[](#-credits)

Created with ❤️ for the Laravel community.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance78

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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 ~10 days

Total

4

Last Release

116d 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 (7 commits)")

---

Tags

laravellocalizationi18nmultilingualbladecomponentfrontenderror-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

[stijnvanouplines/blade-country-flags

A package to easily make use of country flags in your Laravel Blade views.

26307.2k6](/packages/stijnvanouplines-blade-country-flags)

PHPackages © 2026

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