/** * Обновление данных профиля пользователя "студент", с указанным id * * @param int $id * * @return bool * @throws \ErrorException */ public function updateStudent($id) { $student = UserStudent::findOrFail($id); if (!$this->validateProfile()) { return self::FAILED_VALIDATION; } $student->enabled = $this->input['enabled']; if (!$student->save()) { throw new \ErrorException('Failed to save data'); } $this->message = 'Данные успешно сохранены'; return self::RESULT_OK; }