title: A __construct on an Eloquent Laravel Model
body: <p>I have a custom setter that I'm running in a <code>__construct</code> method on my model. </p>
  
  <p>This is the property I'm wanting to set.</p>
  
  <pre><code>    protected $directory;
  </code></pre>
  
  <p>My Constructor</p>
  
  <pre><code>    public function __construct()
      {
          $this-&gt;directory = $this-&gt;setDirectory();
      }
  </code></pre>
  
  <p>The setter:</p>
  
  <pre><code>    public function setDirectory()
      {
          if(!is_null($this-&gt;student_id)){
              return $this-&gt;student_id;
          }else{
              return 'applicant_' . $this-&gt;applicant_id;
          }
      }
  </code></pre>
  
  <p>My problem is that inside my setter the, <code>$this-&gt;student_id</code> (which is an attribute of the model being pulled from the database) is returning <code>null</code>.
  When I <code>dd($this)</code> from inside my setter, I notice that my <code>#attributes:[]</code> is an empty array. <br /> So, a model's attributes aren't set until after <code>__construct()</code> is fired. How can I set my <code>$directory</code> attribute in my construct method?</p>