title: Lumen/Laravel model attributes not included in serialisation?
body: <p>I have defined an Eloquent model <code>Image</code> including something like this:</p>
  
  <pre><code>public function getThumbnailAttribute() {
    return $this-&gt;id . '.jpg';
  }
  </code></pre>
  
  <p>I am fetching the data with a query like this:</p>
  
  <pre><code>Image::query();
  $query-&gt;selectRaw('images.*');
  $query-&gt;join('paths', 'images.id', '=', 'paths.image_id');
  $query-&gt;where('paths.path', 'LIKE', '%' . $request-&gt;input('text') . '%');
  $return = $query-&gt;get();
  </code></pre>
  
  <p>I can access <code>$return[0]-&gt;thumbnail</code> fine, but in the <code>$return</code> array that attribute is not present. The <a href="https://laravel.com/docs/5.5/eloquent-serialization" rel="nofollow noreferrer">docs</a> seem to suggest that it would be, unless <code>$hidden</code> or <code>$visible</code> is set, which they were not, and I've tried setting <code>$hidden</code> to an empty array, too.</p>
  
  <p>I am new to Eloquent, so I've clearly got something wrong. Can anyone point me in the right direction?</p>