Logout all backend users

Is there any way to logout all backend users?

Here you go (please be careful with this stuff though!):

\Backend\Models\User::withTrashed()->update(['persist_code' => null]);
2 Likes

Great, thank you @daft
But when you say be careful with this stuff, I’m now curious as to what harm it could do.

A fair question. Performing bulk queries like this in general can be risky and cause data loss. If you accidentally wipe the password field, it could be quite bad.

1 Like