Version...
Laravel Framework 8.83.26
Laravel Sanctum 2.11
An error message below showed up when logging out.
BadMethodCallException: Method Illuminate\Auth\RequestGuard::logout does not exist.
It says "logout does not exist." Looks like the code "Auth::logout();" has a problem.
Solution
Change "Auth::logout();" to
Auth::guard('web')->logout();
If you are using API tokens, try code below. (I have not tried this yet!)
Auth::guard('sanctum')->user()->tokens()->delete();
Top comments (0)