Support the ongoing development of →
Views Blade Architecture
Last updated 2 years ago.

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!


Your banner here too?

johannesz johannesz Joined 24 Feb 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.