title: Laravel return json or view
body: <p>I'm developing an API where if the user specifies the action with <code>.json</code> as a suffix (e.g. <code>admin/users.json</code>), they get the response in the return of json, otherwise they get a regular html View.</p>
  
  <p>Some actions may not have a json response, in which case they would just return a html View. </p>
  
  <p>Does anyone have advice on how this can be implemented cleanly? I was hoping it could be achieved via the routing.</p>