Exemplo n.º 1
0
 public function destroy(User $user)
 {
     if ($user == Auth::user()) {
         User::destroy($user->id);
         flash()->overlay("Your profile has been deactivated", "Profile Deactivated");
         Auth::logout();
         return redirect(action('HomeController@index'));
     } else {
         User::destroy($user->id);
         flash()->overlay("The profile has been deactivated and can no longer sign-in, but it remains in the system (so that Scores and other records remain consistent.  If you wish to completely destroy all records associated with this user, a System Administrator can forcibly delete the profile.  Likewise, if you ever need to restore access for this user, a System Administrator can re-enable the profile.", "User Deactivated");
         return redirect(action('UserController@index'));
     }
 }