src/Exceptions/HandlesErrors.php
protected function prepareJsonApiException(JsonApiException $ex)
    {
        $error = collect($ex->getErrors())->map(function (ErrorInterface $err) {
            return $err->getDetail() ?: $err->getTitle();
        })->filter()->first();

        return new HttpException($ex->getHttpCode(), $error, $ex);
    }
protected function prepareJsonApiException(JsonApiException $ex)
    {
        $error = collect($ex->getErrors())->map(function (ErrorInterface $err) {
            return $err->getDetail() ?: $err->getTitle();
        })->filter()->first();

        return new HttpException($ex->getHttpCode(), $error, $ex);
    }
protected function prepareJsonApiException ( JsonApiException $ ex ) { $ error = collect ( $ ex -> getErrors ( ) ) -> map ( function ( ErrorInterface $ err ) { return $ err -> getDetail ( ) ? : $ err -> getTitle ( ) ; } ) -> filter ( ) -> first ( ) ; return new HttpException ( $ ex -> getHttpCode ( ) , $ error , $ ex ) ; }
Prepare JSON API exception for non-JSON API rendering.

@param JsonApiException $ex
@return HttpException
Prepare JSON API exception for non - JSON API rendering .