HOW TO ADD PAGINATION IN LARAVEL?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this video we are going to discuss how we can add pagination into our laravel application laravel provides a very simpler and a very basic way to add pagination into your application you don't have to write any code or any uh you don't have to create any routes for this so here you can see in this table we have we have all the users data all of the users coming from the database and there are uh 1000 users into our database and we are returning or printing these these users without any limitation or pagination so this is not a proper way to show your data into a table so to add pagination into this table you just need to go to the controller here you can see i have home controller and in this i used all function that is built-in function and this function will return all all of the users from the database now to add pagination or use pagination you just need to replace this all function so to add pagination you have to use a function that is paginate so let's write paginate here let's use paginate function and in this paginate function you have to pass a parameter that is uh how many users do you want to paginate in one page like we want to paginate 15 users on every one page so let's write 15 here let's save this and let's go and refresh the page so here you can see now there are only 15 users into the into this table but there are no pagination here there are no links to paginate or go to the next page so to add pagination links go to the view file and here you can see i i use bootstrap cd cdn here so i will use built in bootstrap pagination by laravel so just below the table below the table you can write a line to use pagination links and that is a function and that function is the links function and in this links function you can pass a parameter so the parameter you have to pass in this link function is the uh is for the uh framework the front-end framework you are using uh so we are using bootstrap framework for front-end designing so let's pass here pagination double colon bootstrap 4 now this will automatically generate pagination links so let's save it and let's go and refresh the page again now here you can see we we have now uh a beautiful pagination generated by laravel and here you can see all of these links are working properly you can go to next page according to your data you don't have to create any links or you don't have to design anything this is automatically generated with the help of laravel paginate function so i hope that this video will help you to to learn how you can add vagination into your larval project [Music]
Info
Channel: Takneeki Code
Views: 6,134
Rating: undefined out of 5
Keywords: laravel, laravel daily, laravel pagination, pagination in laravel, laravel pagination bootstrap, laravel pagination style, laravel pagination blade, laravel pagination ajax, laravel pagination api, laravel pagination parameter, laravel pagination parameters, laravel pagination limit, bootstrap pagination laravel, tailwind pagination laravel, laravel tailwind, laravel tailwind pagination, laravel pagination links
Id: sfjMVTx1I2s
Channel Id: undefined
Length: 3min 42sec (222 seconds)
Published: Mon Jun 27 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.