In this video, learn how to paginate through records in a database or go through a set number and sort them, making it easy for you to find just the right record.
Now that we've seen the basics of working with a model, … we'll start replacing our database table logic, … to use the model and see how Laravel's Eloquent Layer … can make it easier to work with our database records. … Let's open up the model for our bookings table … which was previously created when we made … the bookings resource controller. … The booking model is located at app, booking.php … Again, this model follows … our standard convention for our models … so nothing interesting here. … We'll use this model, however, to implement pagination … in our listing of bookings. … Let's look at our bookings controller at app, Http, … Controllers, Bookingcontroller.php … We're going to replace line 18 where we're getting … our records with … available booking is going to be equal to booking::paginate. … And now we can update our front end to support pagination. … Let's open up our view for the bookings index page … at resources, … views, bookings, index.blade.php. … So in our view, how can we support pagination? …
- Exploring Laravel
- Setting up simple authentication
- Controllers and routes
- Create and index view
- Show, edit, and destroy views
- Writing scopes in Laravel Eloquent
- Creating one-to-one relationships
Skill Level Beginner
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
Ajax with PHP: Add Dynamic Content to Websiteswith Kevin Skoglund3h 37m Intermediate
What you should know1m 52s
2. Starting Your Project
3. The Create and Index Views
4. The Show, Edit, and Destroy Views
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.