In this video, learn about Laravel Eloquent models and how they can level up your ability to work with databases and quickly organize and access the data contained therein.
- [Narrator] In Laravel, models are what we use … to talk to the database. … Let's fill our first model and see how easy it is … to swap from using our direct database queries, … like we've been doing up to now, … to using models in Laravel Eloquent. … We'll start with using our php artisan … command line interface, to build the model … for our room's table. … In our terminal, from the code directory … inside of our homestead box, … we will want to run the command … php artisan make colon model dash dash factory Room. … We're not going to deal with factories in this course, … but factories make it easier for you … to build instances of the model … to save to the database when you're seeding, … or when you're writing unit test. … Let's go to our text editor to see … what this model provides for us. … We'll open this up in app room dot php. … This class is extremely simple at this point. … It merely defines that is in the app name space. … It imports a base model class that we can extend, …
- 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.