/** * сброс пароля * @return \Response */ public function reset() { Validation::prepareInput(['phone']); $phone = \Input::get('phone'); $validator = Validation::validator(['phone']); if ($validator->fails()) { return $this->responseError($validator, 'Некорректные данные'); } try { $api = new Api(); $response = $api->Remember_pas($phone); if (!empty($response->pwd)) { Customer::instance()->initByPhone($phone)->doChangePasswordSoft($response->pwd); } return $this->responseSuccess([], $response->Msg); } catch (\Exception $e) { return $this->responseException($e, 'Не удалось повторить отправку пароля по смс'); } }