1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/make-models-prunable-to-periodically-delete-them-from-the-db.md
2022-01-21 18:22:44 +01:00

518 B

title tweet_id thread_slug author_username images created_at slug
Make models prunable to periodically delete them from the DB 1484566701089849344 weekly-thread-2022-03 mmartin_joo
https://pbs.twimg.com/media/FJTZyx9XEAcctdk.jpg
2022-01-21T16:40:58+00:00 make-models-prunable-to-periodically-delete-them-from-the-db

💡#Laravel Eloquent Tip

Laravel 8 introduced the Prunable trait. You can use it to delete old models on a scheduled basis.

You don't need to write custom commands anymore: