PHPackages                             pyaesone17/laravel-pretty-handler - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. pyaesone17/laravel-pretty-handler

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

pyaesone17/laravel-pretty-handler
=================================

:package\_description

1.0.1(9y ago)211MITPHPPHP ~5.6|~7.0

Since May 24Pushed 9y ago2 watchersCompare

[ Source](https://github.com/pyaesone17/laravel-pretty-handler)[ Packagist](https://packagist.org/packages/pyaesone17/laravel-pretty-handler)[ Docs](https://github.com/pyaesone17/laravel-pretty-handler)[ RSS](/packages/pyaesone17-laravel-pretty-handler/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel Pretty Handler
======================

[](#laravel-pretty-handler)

The package will allow you to define the error view based on model and based on the request.

**Frontend view of Shop Model Not Found Exception**

[![Frontend Example](https://raw.githubusercontent.com/pyaesone17/laravel-pretty-handler/master/examples/1st.png)](https://raw.githubusercontent.com/pyaesone17/laravel-pretty-handler/master/examples/1st.png)

**Backend view of Shop Model Not Found Exception**

[![Backend Example](https://raw.githubusercontent.com/pyaesone17/laravel-pretty-handler/master/examples/2nd.png)](https://raw.githubusercontent.com/pyaesone17/laravel-pretty-handler/master/examples/2nd.png)

Install
-------

[](#install)

Via Composer

```
$ composer require pyaesone17/laravel-pretty-handler
```

Usage
-----

[](#usage)

Firstly register the serviceprovider in config/app.php like this

```
   [ ....
       Pyaesone17\LaravelPrettyHandler\PrettyServiceProvider::class
   ],
```

Resolve **\\Pyaesone17\\LaravelPrettyHandler\\PrettyHandler** like this in the render method of App\\Exceptions\\Handler.

```
$prettyResponse = ( resolve(\Pyaesone17\LaravelPrettyHandler\PrettyHandler::class)) ($e);

if($prettyResponse){
    return $prettyResponse;
}
```

In the model you have to implement **\\Pyaesone17\\LaravelPrettyHandler\\Pretty** trait and set up using setUp method.

**prettyDefaultView** will be default view of the App\\User not found exception.

**prettyRules** will accept the array list with url and view.

In the following example, if the exception occurs in admin section errors.backend page will show.

If request does not match any url value, it will show default page of the Model that is defined in prettyDefaultView.

```
class User extends Model
{
    use Pretty;

    public function setUpPretty()
    {
        $this->prettyDefaultView = 'errors.coming';
        $this->prettyRules = [
            ['url' => 'admin/*','view' => 'errors.backend'],
            ['url' => 'frontend/*','view' => 'errors.frontend'],
            ['url' => 'shop/*', 'view' => 'errors.coming']
        ];
    }
}
```

Note
----

[](#note)

Do not use **\\Pyaesone17\\LaravelPrettyHandler\\PrettyHandler::class** directly in Handler because it recieve constructor value from the Service Container.

You have to resolve the class fromn the container.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~0 days

Total

2

Last Release

3324d ago

### Community

Maintainers

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

---

Top Contributors

[![pyaesone17](https://avatars.githubusercontent.com/u/11407146?v=4)](https://github.com/pyaesone17 "pyaesone17 (6 commits)")[![nyanwin](https://avatars.githubusercontent.com/u/7732452?v=4)](https://github.com/nyanwin "nyanwin (4 commits)")

---

Tags

error-handlererror-reportingexception-handlerlaravellaravel-5-packagelaravel5-packagemodel-not-foundpyaesone17laravel-pretty-handler

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pyaesone17-laravel-pretty-handler/health.svg)

```
[![Health](https://phpackages.com/badges/pyaesone17-laravel-pretty-handler/health.svg)](https://phpackages.com/packages/pyaesone17-laravel-pretty-handler)
```

###  Alternatives

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.3k133.0M724](/packages/barryvdh-laravel-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.3k2.3M57](/packages/fruitcake-laravel-debugbar)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)

PHPackages © 2026

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