public function register(Request $request) { $user = $this->registersUsers->register($request->all()); if (!$user) { return \ResponseFractal::respondErrorWrongArgs($this->registersUsers->getErrors()); } return \ResponseFractal::respondCreateItemSucess($user, new UserTransformer()); }
/** * @param array $errors */ protected function failedCustomValidate(array $errors) { $response = \ResponseFractal::respondErrorWrongArgs($errors); throw new HttpResponseException($response); }