title: Laravel: Best way to access user information in Vue.js?
body: <p>So tools like <a href="https://vuejsdevelopers.com/2018/01/08/vue-js-roles-permissions-casl/" rel="nofollow noreferrer">CASL</a> make it easy to manage different permissions for users in Vue.js. However, I am wondering what is the best and securest way to access user information in Vue.js when using Laravel? So far I only followed Jeffreys tutorials on laracasts and he simply put these information in the global head-tag via JS:</p>
  
  <pre><code>&lt;script&gt;
      window.App = {!! json_encode([
          'csrfToken' =&gt; csrf_token(),
          'user' =&gt; Auth::user(),
          'signedIn' =&gt; Auth::check(),
      ]) !!};
  &lt;/script&gt;
  </code></pre>
  
  <p>Is this really sufficient or is there a better solution? Feels a little dirty, especially considering that users could simply change their roles to admin/moderator to see their frontend.</p>
  
  <p>Thank you!</p>