title: How can I logout and revoke all oauth tokens in laravel 8 api?
body: <p>The api I built with passport and laravel 8 does not logout by default.</p>
  <p>I found a script, but it does not remove the entries in the oauth-access-tokens table</p>
  <p>I added a function to the AuthController:</p>
  <pre><code> 
      public function logout(Request $request){
          $accessToken = auth()-&gt;user()-&gt;token();
          $token= $request-&gt;user()-&gt;tokens-&gt;find($accessToken);
          $token-&gt;revoke();
          return response(['message'=&gt; 'Je bent uitgelogd'], 200);
      }
  </code></pre>
  <p>And added a path in api.php:</p>
  <pre><code>Route::post( 'logout', 'App\Http\Controllers\API\AuthController@logout')-&gt;middleware('auth:api'); 
  </code></pre>
  <p>When I try to logout with Postman, I get a success message, but the entry in the oauth-access-token table is not removed.</p>
  <p>I intend to remove all tokens for the user, to log out from all devices</p>
  <p>Can anyone tell me what I am doing wrong?</p>