title: How to add meta data in laravel api resource
body: <p>I using laravel api resource for my FRONT-END site.</p>
  <p>Actually i using also laravel pagination to handle paginate in FRONT-END.</p>
  <p>The api resource structure like this:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;data&quot;: [...],
      &quot;links&quot;: [...], // handle pagination
      &quot;meta&quot;: [...] // handle pagination
  }
  </code></pre>
  <p>But i want to send count of query results without considering paginating .For example i paginating database result into <code>30 pre_page</code> and the all of query result is
  <code>200</code> and i want to send this count to view front-end</p>
  <p>I decided to get count of query result and give to resource collection and restructure laravel api resource to this.</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;data&quot;: [...],
      &quot;metadata&quot;: {
          &quot;count&quot;: 200
      },
      &quot;links&quot;: [...], // handle pagination
      &quot;meta&quot;: [...] // handle pagination
  }
  </code></pre>
  <p>Also you sould know maybe i want to add another data to this collection. for example <code>conversion rate</code> in addition count to <code>metadata</code> and i don't know how do this.</p>