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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners