title: Laravel - controller can tell whether request is from web or api route?
body: <p>So basically I want the following in routes web and api which actually go to the same controller but base on whether it's from web or api then it will either return html or json.</p>
  
  <p>So inside this controller is there a way to know which routes the request is from?</p>