title: Laravel modify relationship accessor
body: <p>I have a model called <code>Message</code> which has a column <code>created_by</code> where it refers to the id of the <code>User</code>. Im using Eloquent to retrieve the model and I want to change the <code>created_by</code> field to the full_name of the User instead of returning the id.</p>
  
  <p>I've tried to modify the accessor like this:</p>
  
  <pre><code>public function getCreatedByAttribute()
  {
      return $this-&gt;user-&gt;full_name;
  }
  </code></pre>
  
  <p>But then I get a error: <code>Exception in Response.php line 60:: Failed calling App\Entities\Message::jsonSerialize()</code>.</p>