Let's learn this wonderful feature. You found this wonderful resource https://www.youtube.com/watch?v=557_IL3d9V8 Let's assume that you have some old recordings that you want to delete from the database. First we go to the Model in which we want to implement this feature and use Prunable subMonth())->whereNull('email_verified_at'); }}

Here we see the pruning function and when I use it in the Model, we explain what we want to do after deleting the records protected function pruning() { echo 'Pruning '.

Let's move to Mass Pruning, which deletes records once, but there is a flaw in it nor will the deleting and deleted model events be dispatched.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners