Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
/ RestException Public archive

Handle Excpetions with json response in laravel

License

Notifications You must be signed in to change notification settings

mrjosh/RestException

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Total Downloads Scrutinizer Code Quality License

Josh RestException

Handle Exceptions with json response in laravel

Requirement

  • php 5.5 >=

Install with composer

You can install this package throw the Composer by running:

composer require josh/restexcpetion

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

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

Releases

No releases published

Packages

No packages published

Languages