title: How to get Bearer token from a request in Laravel
body: <p>I am expecting a JWT token from all the incoming request, and it should be included on request headers like: <code>Authorization =&gt; 'Bearer: some token here'</code></p>
  
  <p>I want to get this token and verify it: here is what I am trying:</p>
  
  <pre><code>$token = $request-&gt;header('Authorization');
  </code></pre>
  
  <p>and this is what I get:</p>
  
  <pre><code>"Authorization: Bearer: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJleGFtcGxlLm9yZyIsImF1ZCI6ImV4YW1wbGUuY29tIiwiaWF0IjoxMzU2OTk5NTI0LCJuYmYiOjEzNTcwMDAwMDB9.UQUJV7KmNWPiwiVFAqr4Kx6O6yd69lfbtyWF8qa8iMN2dpZZ1t6xaF8HUmY46y9pZN76f5UMGA0p_CMqymRdYfNiKsiTd2V_3Qpt9LObaLg6rq18j3GLHfdr8nyBzO3v7gTpmNaU6Xy47aMDsbcs593Lx_lD3PnO41oEHgih7CsRKW1WcW1radnpEhdDO7-GpmGOF6xUnpAlQ9EHqpqnIlZPbVoJg92Iwozn-07uuWrkyKUpYN4IPpstd1ks3cKlJ6FH-2ROiC4N0MVLxp4lhUyKhLdwgDWYH4tjtdrEVK0a3_zVtK1ukvriEJqMkfYHnE6Bwv_pv_-lRNy_y7m-YQ"
  </code></pre>
  
  <p>Question is there any way to grab only the token not including <code>"Authorization: Bearer"</code>
    and of course I could parse the whole string and get the token, but I am just wondering if there is another way of getting it without parsing.</p>