src/Exceptions/ApiExceptionHandler.php
private function registerCustomHandlers()
    {
        API::error(function (UnauthorizedHttpException $e) {
            return $this->handleUnauthorized($e);
        });
        API::error(function (AuthorizationException $e) {
            return $this->handleAuthorizationError($e);
        });
        Api::error(function (PermissionsException $e) {
            return $this->handleAuthorizationError($e);
        });
        API::error(function (ValidationException $e) {
            return $this->handleValidation($e);
        });
        API::error(function (ModelNotFoundException $e) {
            return $this->handleModelNotFound($e);
        });
    }
private function registerCustomHandlers()
    {
        API::error(function (UnauthorizedHttpException $e) {
            return $this->handleUnauthorized($e);
        });
        API::error(function (AuthorizationException $e) {
            return $this->handleAuthorizationError($e);
        });
        Api::error(function (PermissionsException $e) {
            return $this->handleAuthorizationError($e);
        });
        API::error(function (ValidationException $e) {
            return $this->handleValidation($e);
        });
        API::error(function (ModelNotFoundException $e) {
            return $this->handleModelNotFound($e);
        });
    }
Register certain handlers via Dingo\API facade

We can't pass class method as callback directly,
so we wrap them into closures.