title: Laravel - using a postgre bytea blob field
body: <p>I am using PostgreSQL on a Laravel installation.  A table has a bytea type field which is being used to store binary data (base64_encoded file contents).</p>
  
  <p>When I use Eloquent to retrieve the table I get a resource type variable being returned in this field.  </p>
  
  <p>How can I rather retrieve this as a string?</p>
  
  <pre><code>$raw = Media::where('id','=',$id)-&gt;first();
  $raw-&gt;file_data = base64_decode($raw-&gt;file_data);   // doesn't work
  </code></pre>