PHPackages                             josh/restexception - 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. josh/restexception

AbandonedArchivedLibrary

josh/restexception
==================

Handle exceptions with json response

018PHP

Since Jan 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/iamalirezaj/RestException)[ Packagist](https://packagist.org/packages/josh/restexception)[ RSS](/packages/josh-restexception/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/08c4803588640b652de0fa23fb9b4ebbae789c65fb66b4723218102332d418a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f73682f72657374657863657074696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josh/restexception)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b75b080f68e0da09e4365c9843f55abd74b1f487ce75710651a68e941374b6eb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f69616d616c6972657a616a2f72657374657863657074696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/iamalirezaj/restexception/?branch=develop)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josh/restexception)

Josh RestException
==================

[](#josh-restexception)

Handle Exceptions with json response in laravel

Requirement
-----------

[](#requirement)

- php 5.5 &gt;=

Install with composer
---------------------

[](#install-with-composer)

You can install this package throw the [Composer](http://getcomposer.org) by running:

```
composer require josh/restexcpetion

```

Use RestException in Exception Handler
--------------------------------------

[](#use-restexception-in-exception-handler)

- you should use the RestException in Handler object
- The Exception Handler is here `app\Exceptions\Hanldler.php`

```
class Handler extends ExceptionHandler
{
    /**
     * Use rest exception in class
     */
    use \Josh\Exception\RestException;
```

- then call the renderRestException method in render method

```
return $this->renderRestException($request , $exception);
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f9e0117221414377b0cfda7d06118a34ad66580e83120387f75dd9990e4694c?d=identicon)[mrjosh](/maintainers/mrjosh)

---

Top Contributors

[![mrjosh](https://avatars.githubusercontent.com/u/9644368?v=4)](https://github.com/mrjosh "mrjosh (2 commits)")

---

Tags

api-exceptionsjson-responsejson-response-of-exceptionsrestexceptions

### Embed Badge

![Health badge](/badges/josh-restexception/health.svg)

```
[![Health](https://phpackages.com/badges/josh-restexception/health.svg)](https://phpackages.com/packages/josh-restexception)
```

PHPackages © 2026

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