title: Get laravels session auth via ajax
body: <p>I have laravel 5.4 running with passport. Which is realy nice.<br>
  My question is now how can I get the acces token for my ajax calls? </p>
  
  <p>What works is this </p>
  
  <pre><code>&lt;script&gt;
      function getData() {
          $.ajax({
              headers: {
                  Authorization: "Bearer " + "eyJ0eXAiOiJK..."
              },
              url: '/api/records/',
              type: 'GET',
              success: function (result) {
                  console.log("yay");
              }
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>What have I to do to NOT hardcode the bearer token?<br>
  Or what to do better? Is this the right approach? <br>
  Is there a magic method where I can get the session and use the session to auth a user?<br> Thanks for your help!</p>