public function ban(User $user)
    {
        $user->is_blocked = ! $user->is_blocked;
        $user->save();

        if ($user->is_blocked) {
            return $this->notifySuccess('User ' . $user->name . ' blocked!');
        } else {
            return $this->notifySuccess('User ' . $user->name . ' un-blocked!');
        }
    }
public function ban(User $user)
    {
        $user->is_blocked = ! $user->is_blocked;
        $user->save();

        if ($user->is_blocked) {
            return $this->notifySuccess('User ' . $user->name . ' blocked!');
        } else {
            return $this->notifySuccess('User ' . $user->name . ' un-blocked!');
        }
    }
public function ban ( User $ user ) { $ user -> is_blocked = ! $ user -> is_blocked ; $ user -> save ( ) ; if ( $ user -> is_blocked ) { return $ this -> notifySuccess ( 'User ' . $ user -> name . ' blocked!' ) ; } else { return $ this -> notifySuccess ( 'User ' . $ user -> name . ' un-blocked!' ) ; } }
Toggle ban status of a user.

@param \App\User $user
@return \Illuminate\Http\JsonResponse
Toggle ban status of a user .