respondNotFound($exception->getMessage()); } elseif($exception instanceof \Illuminate\Database\QueryException) { return $this->respondError($exception->errorInfo, 422); } elseif($exception instanceof \Illuminate\Database\Eloquent\RelationNotFoundException) { return $this->respondError($exception->getMessage(), 422); } elseif($exception instanceof \Prettus\Validator\Exceptions\ValidatorException) { return $this->respondError($exception, 400); } elseif($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) { return $this->respondNotFound('Url not found'); } return parent::render($request, $exception); } }