In this video, Justin teaches you how to find records using the simple ActiveRecords system in Laravel Eloquent to find and return records from the database.
- [Narrator] So we've seen the ability to paginate … over a set of records. … We've seen the ability to get all records, … and we've seen the ability to build in a where clause. … But let's do this with a more standard SQL operation … to be able to find just the records that we want. … We'll open up the Show Room controller at App, … Http, Controllers, ShowRoomsController.php. … We'll replace some of this logic with a more … straightforward approach given some of the tools … Eloquent provides us. … Let's start by erasing the lines from 19 through 22. … Now starting from zero how might we ask the question … if we want to find the rooms, … and possibly limit by room type? … First, we'll begin like we always should in Laravel … by looking at the route. … We'll find the route in Routes, web.php. … Here on line 24, we can add in the ability … to pass in a route type paramater to our rooms URL. … We'll do this by adding in to the string for the rooms URL: … forward slash, and in curly braces, room type question mark. …
- 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.