In this video, Justin demonstrates the technique to build a standard Laravel resource controller, in which you have the ability to list, create, view, edit, and destroy records from your database.
- [Instructor] So we have the routes for our controller, … but what about building a matching controller function … for these actions? … Laravel again makes this super easy. … We'll need to start our Homestead box, … and inside of our terminal application, … we'll want to log in using vagrant SSH, … and then navigate to the code directory. … From here we can run the command php artisan … make colon controller BookingController dash dash resource … for defining this as a resource controller, … and then dash dash model equal Booking. … This defines the corresponding model for this controller. … It'll ask if we want to generate a model, … and in this case we'll say yes. … It'll generate the model, … and it will generate the corresponding controller. … Now let's see what this command did for us. … We'll go to our text editor, open up in app, … http, controllers, BookingController.php. … And if you look at this controller, … you'll see it has all the matching methods … from the ones we defined in our resource routes list. …
- 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.