How to use soft deletes in Laravel

preview_player
Показать описание
In this short 10 minute video, I'll explain exactly what soft deletes are in Laravel and show how to use them in an existing application.

You'll learn how to:

- Soft delete a model
- Return all soft-deleted models in an Eloquent query
- Hard delete a model after soft deleting
- Recover a soft-deleted model back to an active state

- 0:00 Intro
- 01:20 Enabling soft deletes
- 03:20 Create an archive page
- 05:55 Hard delete a model
- 10:14 Wrapping up

Рекомендации по теме
Комментарии
Автор

Thanks Andrew for this great explanation of Soft Deletes.

techbygul
Автор

nice video, thanks for that great explanation!

IsaacKosmos-pg
Автор

Nice! This is also a perfect example of how global scopes work.

killionaire
Автор

what is the theme of your VS code and font? thank you!

markanthonybautista
Автор

Nice! How app you use to screen recorder ?

_frankrocha
Автор

Hi, great video but i get an error, i was able to enable soft deletes and make the achieve method on the controller and view, however when i go to /superheroes/achive (superheroes is my equivalent of cars) i get Attempt to read property "realname" on null, realname is the first column of the superheroes table.

The method achive is working, i wrote its code in the function indec, and when i go to /superheroes it works, but it doesnt on /superheroes/achive, i also added the route exactly like the video

Any idea on what is causing this?

eltiposentadoalli
Автор

Great video. I would like to ask why don't we just create another controller called CarArchiveController and store those methods there? This will keep CarController cleaner.

Quynn-Oneal