PHPackages                             mscharl/pretty-error-page - 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. mscharl/pretty-error-page

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

mscharl/pretty-error-page
=========================

Nice error pages for Laravel 4.2

1.0.0(10y ago)6271PHPPHP &gt;=5.4.0

Since Mar 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mscharl/pretty-error-page)[ Packagist](https://packagist.org/packages/mscharl/pretty-error-page)[ RSS](/packages/mscharl-pretty-error-page/feed)WikiDiscussions master Synced 3w ago

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

mscharl/pretty-error-page
=========================

[](#mscharlpretty-error-page)

[![Total Downloads](https://camo.githubusercontent.com/0d07e4d28ed02c5fecb27ebb9bb7a01469b05a3cc70b1551db9b7fb88434a167/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d73636861726c2f7072657474792d6572726f722d706167652e737667)](https://packagist.org/packages/mscharl/pretty-error-page) [![Latest Version](https://camo.githubusercontent.com/dbec10ff7ba734cfe9480f15d9455bc0b21b54b05116beafba08b2412f5db9c7/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d73636861726c2f7072657474792d6572726f722d706167652e737667)](https://packagist.org/packages/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
-------

[](#install)

This version (1.\*) is compatible with Laravel 4.2

```
composer require mscharl/pretty-error-page:1.*
```

Add the service provider `'Mscharl\PrettyErrorPage\PrettyErrorPageServiceProvider'` to your `app.php` providers array.

Publish public assets

```
php artisan asset:publish
```

---

Customize
---------

[](#customize)

You can easily customize the output of this package by following those steps

### Configuration

[](#configuration)

```
php artisan config:publish mscharl/pretty-error-page
```

##### Config values

[](#config-values)

- always\_pretty `bool|null`
    - `null` (default) use pretty error page only when debug mode is off
    - `true` always show pretty error page (except when expecting a JSON-Response)
    - `false` never show pretty error page

### Translations

[](#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:

```
pretty-error-page-customized::404.title > pretty-error-page-customized::general.title > pretty-error-page::404.title > pretty-error-page::general.title

```

##### Customize specific error code translations

[](#customize-specific-error-code-translations)

Create a `[errorcode].php` file into `app/lang/packages/mscharl/pretty-error-page/[langcode]`.

##### Customize fallback translations

[](#customize-fallback-translations)

Create a `generic.php` file into `app/lang/packages/mscharl/pretty-error-page/[langcode]`.

##### Required translation keys

[](#required-translation-keys)

```
