I don't know enough about Laravel to answer with authority on Laravel, but I suspect this is not a Laravel issue but an architecture / process issue.
My solution would be to load first before doing the heavy lifting, then load the required data using AJAX.
You can either return the results as JSON, and use JavaScript to populate your page, or just return a rendered view and insert that directly.
davestewart said:
I don't know enough about Laravel to answer with authority on Laravel, but I suspect this is not a Laravel issue but an architecture / process issue.
My solution would be to load first before doing the heavy lifting, then load the required data using AJAX.
You can either return the results as JSON, and use JavaScript to populate your page, or just return a rendered view and insert that directly.
How do I do that though?
Well, instead of running all the DB setup in your index controller:
Something like this:
$.get('clans/load', function(html){
$('#content').html(html);
});
You could even pass variables via the route to the load() method if you wanted, such as page, count, etc. and wire these to links in the HTML page.
Loads of advice out there on jQuery. If you don't know it, now is the time to learn!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community