public function activate(User $user)
    {
        $user->is_activated = ! $user->is_activated;
        $user->save();

        if ($user->is_activated) {
            return $this->notifySuccess('User ' . $user->name . ' activated!');
        } else {
            return $this->notifySuccess('User ' . $user->name . ' deactivated!');
        }
    }
public function activate(User $user)
    {
        $user->is_activated = ! $user->is_activated;
        $user->save();

        if ($user->is_activated) {
            return $this->notifySuccess('User ' . $user->name . ' activated!');
        } else {
            return $this->notifySuccess('User ' . $user->name . ' deactivated!');
        }
    }
public function activate ( User $ user ) { $ user -> is_activated = ! $ user -> is_activated ; $ user -> save ( ) ; if ( $ user -> is_activated ) { return $ this -> notifySuccess ( 'User ' . $ user -> name . ' activated!' ) ; } else { return $ this -> notifySuccess ( 'User ' . $ user -> name . ' deactivated!' ) ; } }
Toggle user activation status.

@param \App\User $user
@return \Illuminate\Http\JsonResponse
Toggle user activation status .