In this tutorial, we will learn how to use the Laravel soft delete concept.
Soft Delete
Force Delete
Fetch Deleted Records
Restore Records
How Laravel Soft Delete Works?
When we use soft delete in the project then records are not actually removed from the database. Instead of that timestamp has been assigned to the deleted_at column. Also, when you query the model that uses soft deletes then Laravel retrieves those records which timestamps are nulled in deleted_at column.
Contents of this video:
00:00 - Demo
01:44 - Create Article Table, Model And Factory
03:19 - Create Database
03:49 - Create Article Controller
04:03 - Show Articles
06:13 - Soft Delete
07:07 - Fetch Deleted Records
08:58 - Restore Records
10:06 - Restore All Records
10:57 - Force Delete
#softDelete #forceDelete #restoreRecords