In this video, learn the skills needed to write a standard Laravel edit view form, to display the default data for your form inputs, and to reduce the duplication of your view code across your view files.
- [Instructor] At this point, we now have two forms … that both display our form prealds, … but we really want to be able to condense that logic … and not perform so much duplication in our code base. … As well as, we also need our edit Blade form … to display the existing data for our booking record. … Our first task, reducing the duplication in our code base, … should be fairly easy given … what you've seen of Blade up to now. … Let's open up our create Blade template, … at resources, views, bookings, create.blade.php. … Let's copy all of the form fields, … which will be from line six through 67. … We'll erase those, and let's create a new file … in our bookings directory. … This file, we'll save as fields.blade.php. … We'll paste in the contents from our line six through 67, … as lines one through 62 here. … We'll go back to our create.blade.php file, … and in here, what we'll do, is on line six, … we'll add a @include parentheses, … and in single quotes, bookings.fields. … This includes is another blade directive …
- 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.