/** * Persist the changes. * * @param Password $password * @param PasswordFolder $folder * * @return bool */ public function persist(Password $password, PasswordFolder $folder) { $password->folder_id = $folder->id; $password->title = $this->input('title', $password->title); $password->website = $this->input('website', $password->website); $password->username = $this->input('username', $password->username); $password->password = $this->input('password', $password->password); $password->notes = $this->input('notes', $password->notes); return $password->save(); }
public function resetPassword(User $user) { $token = sha1(mt_rand()); $password = new Password(); $password->email = $user->email; $password->token = $token; $password->created_at = Carbon::now(); $password->save(); $data = ['first_name' => $user->first_name, 'token' => $token, 'subject' => 'Password Reset Link', 'email' => $user->email]; $this->userMailer->passwordReset($user->email, $data); }