title: Is it possible to map a column name in an Laravel Eloquent model?
body: <p>I have a DB table with a column "visible" (true/false).</p>
  
  <p>The Eloquent model already has a property visible, see this code snippet taken from Illuminate\Database\Eloquent\Model.</p>
  
  <pre><code>/**
   * The attributes that should be visible in arrays.
   *
   * @var array
   */
  protected $visible = array();
  </code></pre>
  
  <p>When printing out the model, the "visible" property is the already existing array instead of the column value. Is there a way to rename the column in the Model? I already tried this (found here: <a href="http://laravel.com/docs/4.2/eloquent#accessors-and-mutators" rel="nofollow">http://laravel.com/docs/4.2/eloquent#accessors-and-mutators</a>)</p>
  
  <pre><code>public function setVisibleAttribute($value) {
      $this-&gt;attributes['isvisible'] = $value;
  }
  public function getVisibleAttribute($value) {
      $this-&gt;attributes['isvisible'];
  }
  </code></pre>
  
  <p>I know I can solve the problem like this:</p>
  
  <pre><code>User::select('id', 'name', 'visible as isVisible')-&gt;get(); 
  </code></pre>
  
  <p>I was just wondering if there  isn't a really built in mechanism.</p>
  
  <p>Important note: the DB is also used by existing software so renaming it isn't really an option.</p>