title: Auth facade returns null if called from Controller with api route
body: <p>I am accessing a <code>PayPalController</code> through routes in <code>routes/api.php</code> but when I try to check if a user is authenticated, it returns <code>null</code>.</p>
  <p><strong><code>PayPalController</code></strong>:</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Auth;
  use Srmklive\PayPal\Service\Paypal;
  
  class PayPalController extends Controller
  {
      public function create(Request $request)
      {
  
          // returns null
          $id = Auth::id();
  
          // can't read &quot;id&quot; of null
          $id = auth('api')-&gt;user()-&gt;id;
          
      }
  }
  </code></pre>
  <p><strong><code>routes/api.php</code></strong>:</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Route;
  
  
  Route::post('/paypal/order/create', [PayPalController::class, 'create']);
  </code></pre>
  <p>I've tried creating an <code>api guard</code> in <code>config/auth.php</code> and using it like so:</p>
  <pre><code>auth('api')-&gt;user()-&gt;id
  </code></pre>
  <p>but it changes nothing.</p>
  <p><strong>Edit</strong>:</p>
  <p>A user is authenticated and it still returns null.</p>