One possible solution is to add the following code to the logout function:
$request->session()->invalidate();
$request->session()->regenerateToken();
This will invalidate the session and generate a new CSRF token, which should prevent any cached authentication tokens from being reused.
Here is the updated logout function:
public function adminLogout(Request $request)
{
auth()->logout();
// remove user credentials from session
$request->session()->forget('user');
$request->session()->invalidate();
$request->session()->regenerateToken();
//Redirect to Login Page
return redirect('/');
}
Note that the Session::regenerate() method is no longer needed, as invalidate() already regenerates the session ID.
Also, make sure to clear your browser cache and cookies to ensure that any cached authentication tokens are removed.