Skip to content

Commit

Permalink
chore: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lakuapik authored Jul 24, 2022
1 parent 462433f commit 0a6d59e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ you can use the `ExceptionHandler::renderAsApiResponse` helper.
```php
// file: Exception/Handler.php

use KodePandai\ApiResponse\ExceptionHandler;
use KodePandai\ApiResponse\ExceptionHandler as ApiExceptionHandler;

// new laravel (>= 8)
public function register()
{
$this->renderable(function (Throwable $e, $request) {
if ($request->wantsJson()) {
return ExceptionHandler::renderAsApiResponse($e);
return ApiExceptionHandler::renderAsApiResponse($e);
}
});
}
Expand All @@ -146,7 +146,7 @@ public function register()
public function render($request, Throwable $exception)
{
if ($request->wantsJson()) {
return ExceptionHandler::renderAsApiResponse($exception);
return ApiExceptionHandler::renderAsApiResponse($exception);
}

return parent::render($request, $exception);
Expand Down

0 comments on commit 0a6d59e

Please sign in to comment.