title: Need to set a 1 to many relationship in the same table in Laravel 4
body: <p>I have the following models</p>
  
  <p>Category:</p>
  
  <pre><code>&lt;?php
  
  class Category extends Eloquent {
      protected $table = "category";
      protected $fillable = array('title','parent','metatit','metadsc','metake','metaurl','image');
      public function categoryitems(){
          return $this-&gt;hasMany('CategoryItem','catid');
      }
      public function parent(){
          return $this-&gt;hasMany('category','parent');
      }
      public function child(){
          return $this-&gt;belongsTo('Category','parent');
      }
  }
  </code></pre>
  
  <p>Need to set a 1 to many relationship in the category table 
  Ex category "cities" is a child of category "countries"</p>
  
  <p>the error happen when i try to use the following code</p>
  
  <pre><code>&lt;?php
  
  $parent = Category::where('id','=',$cat-&gt;id)-&gt;parent;
  echo $parent-&gt;title;
  
  ?&gt;
  </code></pre>
  
  <p>The error :</p>
  
  <blockquote>
    <p>ErrorException (E_UNKNOWN) 
    Undefined property: Illuminate\Database\Eloquent\Builder::$parent (View: /var/www/phpWithAngulerJS/app/views/admin/category-edit.blade.php)</p>
  </blockquote>