Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chibyke's avatar

Ajax like Pagination

Please i have three different paginated tables on my page and i noticed that when i click on the next link in one of the tables, it affects the other tables. that is, their view will change. But that is not what i want. I want the content of the other tables to remain the when i click on any of the other tables. I know i can use jquery ajax to achieve this but am returning a model that is related to other models like this.

$loaded_buses = LoadedBus::latest()->where('branch_id',$branch->id)->simplePaginate(4);

after foreach i can do the following

$loaded_bus->driver->fullname
$loaded_bus->route->branchname    

This loaded buses is related to the BusDriver Model and My Route Model. And i have to display then on my view. The problem is that with ajax i do no know if this relationship will be maintained. Please i just started using Laravel 5 and i need assistance

0 likes
0 replies

Please or to participate in this conversation.