title: Laravel API request middleware unathenthicated
body: <p>I need your help with my Laravel API HTTP Request. I am trying to get a response from my api. But it sends back "Error: "Request failed with status code 401" and the AuthenthicationException shows "Unauthenticated." . I have not found any solutions. I need your help... Thanks.</p>
  
  <pre><code>const response = (await rootApi.get(`/openSesame/targets/${id}`)).data;
  </code></pre>
  
  <p>My 'Api\TargetController</p>
  
  <pre><code>public function detail($id)
      {
          $spintaxInput = SpintaxInput::find($id);
          if (!$spintaxInput) {
              return response()-&gt;json(['error' =&gt; "Not found."], 404);
          }
          return response()-&gt;json($spintaxInput, 200);
      }
  </code></pre>
  
  <p>My api routes</p>
  
  <pre><code>Route::group(['middleware' =&gt; ['auth:web']], function () {
  
      Route::group(['prefix' =&gt; 'openSesame'], function () {
          Route::get('/targets/{id}', 'Api\TargetController@detail');
      });
  
  });
  
  </code></pre>