title: Laravel Auth User add custom data
body: <p>We are currently working on an application with a Google Login with Laravel with Socialite. We have a Auth user who gets a permission number ex. 264. We have made a function which returns an array with all binary numbers this permission number is made off.</p>
  
  <p>Because calling this function every single time a page loads may be kinda heavy, we thought of adding this once when the Auth::user() is created. We thought of adding a custom constructor in the Model, but we can't make it work.</p>
  
  <pre><code>function __construct($attributes = array()) {
    parent::__construct($attributes);
    $this-&gt;permissionsArray = PermissionHelper::permissionConverter($this-&gt;permissions);
  }
  </code></pre>
  
  <p>But we can't get it to work, <code>$this</code> doesn't have values when calling this function.</p>
  
  <p>TLDR;
  Directly after making the Auth user I want to call the permissionConverter function and save the data to the user so we can use it more often. Any suggestions on how to do this?</p>
  
  <p>EDIT: I checked all answers out today, succeeded with one of them, but I assumed Laravel put the authenticated user in the SESSION or something. I found out it doesn't and it gets all the data from the database every request. We couldn't do what we requested for unfortunately. So I just had to refactor the script and make it as efficient as possible (although it became a bit less readable for less experienced programmers).</p>
  
  <p>Thanks for the help :D  </p>