Download the PHP package mscharl/pretty-error-page without Composer
On this page you can find all versions of the php package mscharl/pretty-error-page. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pretty-error-page
mscharl/pretty-error-page
This package provides nice looking, customizable and localizable error pages, with two predefined views for Laravel.
By default pretty error pages are displayed when debug-mode is disabled and the requests does not expects a JSON-response.
Install
This version (1.*) is compatible with Laravel 4.2
Add the service provider 'Mscharl\PrettyErrorPage\PrettyErrorPageServiceProvider'
to your app.php
providers array.
Publish public assets
Customize
You can easily customize the output of this package by following those steps
Configuration
Config values
- always_pretty
bool|null
null
(default) use pretty error page only when debug mode is offtrue
always show pretty error page (except when expecting a JSON-Response)false
never show pretty error page
Translations
Unfortunately publishing lang-files like config- or view-files is not supported by default. But you still can customize the translation since they are the easiest way to customize a general or specific error output. You do not need to edit anything inside the views. Translations are automatically loaded by the thrown http-status-code.
Translation will be looked up by the package in the following order:
Customize specific error code translations
Create a [errorcode].php
file into app/lang/packages/mscharl/pretty-error-page/[langcode]
.
Customize fallback translations
Create a generic.php
file into app/lang/packages/mscharl/pretty-error-page/[langcode]
.
Required translation keys
Views
You can either override the predefined templates or just add custom error pages for specific error codes.
layouts
mail.blade.php
: This file is used to render the email body that can be sent by the user getting the error to inform you about the incidence.default.blade.php
: This file is used to define a general layout for the error pages. Every error template should extend this layout for simplicity.
-
shared variables:
$message
: The error message$exception
: The full PHP-Exception
partials/log.blade.php
: This file defines the log that can be sent to you by mail. The log is automatically included into every mail by the mail layout.[langcode].blade.php
: The E-Mail body for the language with this language code
pages
The error pages. There is a simple naming system.
If an error page is displayed the specific error code is used as the primary filename e.g. 503
. If this is not found 5xx
will be used. If this is still not found any
will be used as fallback.
404.blade.php
: The predefined 404-Error-Page503.blade.php
: The predefined 503-Error-Pageany.blade.php
: The fallback error page if no specific page is found