title: Set default JSON format response Laravel
body: <p>I'm practicing to make a good RESTful API services following this guide from Google (<a href="https://google.github.io/styleguide/jsoncstyleguide.xml" rel="nofollow noreferrer">https://google.github.io/styleguide/jsoncstyleguide.xml</a>) for the json format response.</p>
  
  <p>Is there any way to set the default JSON format for every response because in the guide said </p>
  
  <blockquote>
    <p>In order to maintain a consistent interface across APIs, JSON objects
    should follow the structure outlined below.</p>
  </blockquote>
  
  <pre><code>object {
    string apiVersion?;
    string context?;
    string id?;
    string method?;
    object {
      string id?
    }* params?;
    object {
      string kind?;
      string fields?;
      string etag?;
      string id?;
      string lang?;
      string updated?; # date formatted RFC 3339
      boolean deleted?;
      integer currentItemCount?;
      integer itemsPerPage?;
      integer startIndex?;
      integer totalItems?;
      integer pageIndex?;
      integer totalPages?;
      string pageLinkTemplate /^https?:/ ?;
      object {}* next?;
      string nextLink?;
      object {}* previous?;
      string previousLink?;
      object {}* self?;
      string selfLink?;
      object {}* edit?;
      string editLink?;
      array [
        object {}*;
      ] items?;
    }* data?;
    object {
      integer code?;
      string message?;
      array [
        object {
          string domain?;
          string reason?;
          string message?;
          string location?;
          string locationType?;
          string extendedHelp?;
          string sendReport?;
        }*;
      ] errors?;
    }* error?;
  }*;
  </code></pre>
  
  <p>I'm practicing with Laravel 5.4. Should I just make a trait and use make own JSON response format? Because, it's so cumbersome having to write that kind of response every time you return a JSON response.</p>