xeeshan's avatar

multiple ajax calls in one controller function : HELP

Hello Guys

im loading 2 arrays of data in one view code is below:

public function index(){

$music=Feature::where('video_type', 'Music')->paginate(8); $fashion=Feature::where('video_type', 'Fashion')->paginate(8);

    return view('feature.index', compact('music', 'fashion'));

}

now im using pagination and rendring data in two different sections.. im showing pagination now i want pagination to work with AJAX. letme explain more

  • if someone will click on 2nd page from music section an ajax call will get the second page data and render in place of the 1st page in music section

  • same thing goes with Fashion section if someone will click on 2nd page a ajax call will go and get the fashion 2nd page data and render it on fashion section in place of 1st page

i can understand it might be tough or stupid of me (but client is always right and i have to do it ) if anybody helps me out i will be thankful :|

i have a tutorial how to change the data with ajax https://laraget.com/blog/how-to-create-an-ajax-pagination-using-laravel

but it will only get one request and it only give one category data

guys i really need help on it please if somebody can help :|

Thanks in advanced

0 likes
2 replies
xeeshan's avatar

never mind did it :) thanks for no reply ;)

Please or to participate in this conversation.