You may create controllers for both, users with js and without. Before routing you would create a Middleware to check if user has js. This is the easiest way in my opinion.
Depending on your controllers and what they return you could create a master Middleware controller. You create a controller as usual for all your modules. The controllers than only return the json data. Your master controller or a Middleware could hook the process between controller - frontend and decide either it's js or not. If I am not wrong Laravel fires events before rendering a view. So you could start there.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community