title: Best practice when building both RESTful API and web application
body: <p>So i'm developing a project using <code>Laravel 5.7</code>, and I want to include a RESTful API to make the mobile version communicate with the app, and of course the web application itself.</p>
  
  <p>My question is, what is the best practice is such cases when it comes to routing and controllers, I have read some suggestions here and other blogs and got confused, some  suggested that I should declare One Routing file to be used by the web app and API and add an identifier for <strong>e.g("web" and "mobile")</strong> and based on it I return a view or <code>JSON</code> data, others suggested to separate the routing (api and web) but point them to the same controller methods which is think it's better than the first suggestion.</p>
  
  <p>Appreciate your help.</p>