title: How to rename relation function in eloquent?
body: <p>I using Laravel 5.3 .this my query and I want in result array the 'children_rec' renamed to 'node'.</p>
  
  <pre><code> $boxes = Boxes::with('children_rec')
                  -&gt;whereNull('box_id')
                  -&gt;with('position')
                  -&gt;get()
                  -&gt;toJson(128);
  </code></pre>
  
  <p>UPDATE:
  Relation code:</p>
  
  <pre><code>public function child()
  {
      return $this
          -&gt;hasMany('PTA_OIMS\Boxes', 'box_id');
  }
  
  public function children_rec()
  {
      return $this-&gt;child()
          -&gt;with('children_rec')
          -&gt;with('position');
  }
  </code></pre>
  
  <p>thanks</p>