title: How do I correctly hide model relationships from returning in toArray() or toJson()?
body: <p>I'm currently working on a project where I'm writing an API, and with a lot of the models, I'm trying to hide their parent relationships from being returned, like so</p>
  
  <pre><code>&lt;?php namespace Viper\Model;
  
  class User_Token extends Eloquent {
  
      protected $table = 'users_tokens';
  
      protected $fillable = array(
          'user_id', 'token'
      );
  
      protected $hidden = array(
          'id', 'user_id', 'user'
      );
  
      public function user() {
          return $this-&gt;belongsTo('User');
      }
  
  }
  </code></pre>
  
  <p>In the Laravel documentation, for the <a href="http://laravel.com/docs/eloquent#converting-to-arrays-or-json" rel="nofollow">Eloquent > Converting to Array or Json</a> section, it clearly says</p>
  
  <blockquote>
    <p>Note: When hiding relationships, use the relationship's method name,
    not the dynamic accessor name.</p>
  </blockquote>
  
  <p>What exactly does this mean? In the above example, both the method name and the dynamic accessor name are the same, and I can't for the life of me, think of a situation where this wouldn't be the case.</p>