title: laravel out of box vuejs example not working
body: <p>I'm simply trying to learn vuejs with laravel and cannot get the example component working.</p>
  
  <p>I have created a fresh route to simply serve the vue example for now.</p>
  
  <pre><code>create.blade.php
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;VUE&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;h1&gt;example&lt;/h1&gt;
  
  &lt;div id="app"&gt;
  
  &lt;example&gt;&lt;/example&gt;
  
  &lt;/div&gt;
  
  &lt;script src="/js/app.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The app.js and example.vue files are exactly as out of the box ( so i won't bother showing example.vue here</p>
  
  <pre><code>require('./bootstrap');
  
  window.Vue = require('vue');
  
  Vue.component('example', require('./components/Example.vue'));
  
  const app = new Vue({
      el: '#app'
  });
  </code></pre>
  
  <p>I have <code>npm run watch</code> running and it seems to have built the app files ok.</p>
  
  <p>Controller and route is fine, as page is loading, but I'm getting console error as follows</p>
  
  <pre><code>app.js:1697 Uncaught TypeError: Cannot read property 'csrfToken' of 
  undefined
  at Object.&lt;anonymous&gt; (app.js:1697)
  at __webpack_require__ (app.js:20)
  at Object.&lt;anonymous&gt; (app.js:778)
  at __webpack_require__ (app.js:20)
  at Object.&lt;anonymous&gt; (app.js:41430)
  at __webpack_require__ (app.js:20)
  at app.js:66
  at app.js:69
  </code></pre>
  
  <p>When i click the console error in chrome it points to the line in app.js:</p>
  
  <pre><code>window.axios.defaults.headers.common['X-CSRF-TOKEN'] = 
  window.Laravel.csrfToken;
  </code></pre>
  
  <p>Is it complaining about csrftoken because I've used it as a blade template ?
  How can I get it working inside laravel, just so i can play with and learn vuejs ?</p>