laravelsessionauthenticationlaravel-5.7

How to Force Logout all users from backend Admin Panel in Laravel?


Im trying to force logout all logged users in website from admin panel .

for testing purpose i have logged in 3 different browsers , I have cleared all entries from sessions table from database , and then try to refresh page but user remains logged in like below :

enter image description here

and found new entries in sessions table

but i want like below , when force logout from backend .

enter image description here

I want to force logout user and clear all sessions please guide me how to do it ?


Solution

  • If you have a remember_token column in your users table, you might want to update that one as well:

    DB::table('users')->update(['remember_token' => null]);