In this video, Justin walks you through the steps to soft-delete or make a record no longer visible in your web application but still available in your database.
- [Instructor] Soft deleting is the ability for us … to delete a record, but not actually delete the record … from the database. … We use a field. … In Laravel the standard is [email protected] … This [email protected] field is a timestamp that records the time … when we're saying, hey this record is no longer useful. … We want it to no longer show up in the interface of … our application, but we do want to hold on to it … just in case. … So how does this work? … Since we already have [email protected] field on our … bookings record, all we really need to do is tell … our model to use a tree, a soft delete tree. … We'll open up our booking model at App Booking.php. … We'll load in our tree by first telling it to load … in the class. … We'll do use Illuminate\Database\Eloquent\SoftDeletes. … Next we'll load in this tree into our class by adding … on line 10, use SoftDeletes. … That's actually all the changes we need to make … in our code base. … One of the nice things about this tree is the method … that we call to soft delete records is the same one …
- 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.