Пример #1
0
 /**
  * Delete the user's profile.
  *
  * @return \Illuminate\Http\Response
  */
 public function deleteProfile()
 {
     $user = Credentials::getUser();
     $this->checkUser($user);
     $email = $user->getLogin();
     Credentials::logout();
     try {
         $user->delete();
     } catch (\Exception $e) {
         return Redirect::to(Config::get('core.home', '/'))->with('error', 'There was a problem deleting your account.');
     }
     $mail = ['url' => URL::to(Config::get('core.home', '/')), 'email' => $email, 'subject' => Config::get('core.name') . ' - Account Deleted Notification'];
     Mail::queue('emails.userdeleted', $mail, function ($message) use($mail) {
         $message->to($mail['email'])->subject($mail['subject']);
     });
     return Redirect::to(Config::get('core.home', '/'))->with('success', 'Your account has been deleted successfully.');
 }
Пример #2
0
 /**
  * Logout the specified user.
  *
  * @return \Illuminate\Http\Response
  */
 public function Logout()
 {
     Credentials::logout();
     return Redirect::to(Config::get('core.home', '/'));
 }