Download the PHP package vkm-apps/x-error without Composer
On this page you can find all versions of the php package vkm-apps/x-error. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vkm-apps/x-error
More information about vkm-apps/x-error
Files in vkm-apps/x-error
Package x-error
Short Description A Laravel package providing multilingual error pages.
License MIT
Homepage https://github.com/vkm-apps/x-error
Informations about the package 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
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?
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 & Unobtrusive:
- Standard debuggers (like Ignition) are fully preserved in
localdevelopment or whenapp.debugis enabled. - API and JSON requests automatically bypass X-Error, letting Laravel handle API error responses natively.
- Standard debuggers (like Ignition) are fully preserved in
- Total Customization: Map unique theme colors to specific HTTP status codes, configure redirect actions, or bring your own template utilizing the
<x-vkm-error />Blade component.
๐ Requirements
- PHP:
^8.1 - Laravel (illuminate/support):
^10.0 | ^11.0 | ^12.0 | ^13.0
๐ฆ Installation
Install the package via Composer:
Laravel will automatically discover and register the service provider.
โ๏ธ Publishing Assets
You may publish the package resources as needed.
Publish Configuration
Publish Views (optional)
Publish Translations (optional)
๐ง 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:
These variables are always available โ including when using your own custom layout.
๐งฉ Blade Component
The package registers a reusable component that is automatically available in all views:
Component Props & Slots
You can customize the <x-vkm-error /> component with the following properties:
| Prop / Slot | Type | Description |
|---|---|---|
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
๐จ Configuration
The configuration file is published at config/x-error.php.
Layout
You may define a custom layout view. If set, you must manually include the <x-vkm-error /> component in your layout file.
Exception Details
Control visibility of exception stack traces.
- 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
Define colors mapped to HTTP status codes (Tailwind CSS classes recommended).
Redirect Button
A redirect button shown on all error pages (except status code 503).
๐ Localization
Error titles and messages are fully translatable. The package resolves translations using:
Example Translation File Structure (lang/vendor/x-error/{locale}/errors.php):
Translations can be published using the
--tag="x-error-lang"flag and customized as needed.
๐งช 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:
All values are automatically injected by the exception handler into your custom view.
๐ก Best Practices
- Security First: Enable exception details (
exception.enabled => true) only inlocal/stagingenvironments or restrict them with a robustpermissioncheck 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
This package is open-sourced software licensed under the MIT license.
โญ Credits
Created with โค๏ธ for the Laravel community.