MarcinOrlowski / laravel-api-response-builder

Builds nice, normalized and easy to consume REST JSON responses for Laravel powered APIs.
MIT License
721 stars 79 forks source link

Exception handler - Incorrect documentation #239

Open beeyev opened 1 year ago

beeyev commented 1 year ago

The documentation has incorrect implementation of exception handler. Here

there is no handle method in ExceptionHandlerHelper

ehsan-soleimanian commented 1 year ago

@beeyev you are right. you have to use this code in Handler.php instead :

public function register(): void { $this->renderable(function (Throwable $ex, $request) { return ExceptionHandlerHelper::render($request, $ex); }); }