In this video, learn the skills needed to write a standard Laravel create action, where you organize the data needed to create new records in your database.
- [Instructor] The Create action is where in Laravel … we'll render the form for creating a new booking. … In many cases our controller might just call out … to render a Blade view file. … However, in our particular case, … we'll also need to load in the listing of rooms and users. … Let's open up our booking controller … at app, http, … Controllers, … BookingController.php, … We're going to fill out our create action on line 30 … by adding users … is going to be equal to DB colon, colon, … table, parentheses, single quote, users, … arrow, … get. … So we're going to get the listing of users … to be able to define that this booking … was created for this user. … We now also need the list of rooms. … We're going to do that on line 31 with rooms … is equal to DB colon, colon, table, parentheses, … and single quotes, rooms, arrow, get. … Notice here our DB facade is able to talk … to multiple different tables even though … we haven't previously built any logic for these classes. … Keep in mind that's because our DB class …
- 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.