title: What is the purpose of API Resources?
body: <p>I've read the <a href="https://laravel.com/docs/5.5/eloquent-resources" rel="noreferrer">docs</a> and watched the Laracast. I'm still left wondering why you would use them?</p>
  
  <p>I get that you can map different data to different names if your field names were to change but you want to keep a consistent public API. But surly you can just do the same on the model with the toArray() method and change the mappings there?</p>
  
  <p>If I were to do:</p>
  
  <pre><code>return User::find(1);
  </code></pre>
  
  <p>I get a response like:</p>
  
  <pre><code>{"id":1,"name":"Ova Parker"}
  </code></pre>
  
  <p>If I do:</p>
  
  <pre><code>return new UserResource(User::find(1));
  </code></pre>
  
  <p>I get a response like:</p>
  
  <pre><code>{"data":{"id":1,"name":"Ova Parker"}}
  </code></pre>
  
  <p>Is there a significance in wrapping it with a data tag? I am just guessing but is this a standard JSON format for API's? Why would you not just do <code>return User::find(1);</code> instead of using an API resource, if this is under API routes then it'll return it as JSON anyway automatically.</p>