title: How to Paginate loaded relation with Laravel API resources
body: <p>I need to load model relations in it's resource and paginate them.</p>
  <p>In my case i have <code>Category</code> and <code>Path</code> models, plus <code>CategoryResource</code> and <code>PathResource</code></p>
  <p>The <code>toArray</code> method of <code>CategoryResource</code> is like below:</p>
  <pre><code>public function toArray($request)
  {
      return [
          'id'   =&gt; $this-&gt;id,
          'name' =&gt; $this-&gt;name,
          'slug' =&gt; $this-&gt;slug,
          'order' =&gt; $this-&gt;order,
          'paths' =&gt; PathResource::collection($this-&gt;whenLoaded('paths'))
      ];
  }
  </code></pre>
  <p>and <code>toArray</code> method of <code>PathResource</code> is like below:</p>
  <pre><code>public function toArray($request)
  {
      return parent::toArray($request);
  }
  </code></pre>
  <p><strong>Question</strong> is how can i load and paginate related <code>Path</code>'s in my <code>CategoryResource</code>?</p>