/** * Create a new exception instance. * * @param Validator $validator */ public function __construct(Validator $validator) { $this->validator = $validator; parent::__construct(); }
/** * Renders any API exception into a JSON error response. * * @param ApiException $exception * @return JsonResponse */ protected function renderApiError(ApiException $exception) : JsonResponse { return app('responder.error')->setError($exception->getErrorCode(), $exception->getMessage())->addData($exception->getData() ?: [])->respond($exception->getStatusCode()); }