public function destroy(User $user, $force = false)
    {
        if ($user->id <> auth('administrator')->id()) {
            try {
                if ($force) {
                    $user->forceDelete();
                } else {
                    $user->delete();
                }

                return $this->notifySuccess('User successfully deleted!');
            } catch (QueryException $e) {
                return $this->notifyError($e->getMessage());
            }
        }

        return $this->notifyError('You cannot delete your own record!');
    }
public function destroy(User $user, $force = false)
    {
        if ($user->id <> auth('administrator')->id()) {
            try {
                if ($force) {
                    $user->forceDelete();
                } else {
                    $user->delete();
                }

                return $this->notifySuccess('User successfully deleted!');
            } catch (QueryException $e) {
                return $this->notifyError($e->getMessage());
            }
        }

        return $this->notifyError('You cannot delete your own record!');
    }
public function destroy ( User $ user , $ force = false ) { if ( $ user -> id <> auth ( 'administrator' ) -> id ( ) ) { try { if ( $ force ) { $ user -> forceDelete ( ) ; } else { $ user -> delete ( ) ; } return $ this -> notifySuccess ( 'User successfully deleted!' ) ; } catch ( QueryException $ e ) { return $ this -> notifyError ( $ e -> getMessage ( ) ) ; } } return $ this -> notifyError ( 'You cannot delete your own record!' ) ; }
Remove selected user.

@param \App\User  $user
@param bool|false $force
@return \Illuminate\Http\JsonResponse
@throws \Exception
Remove selected user .