The Laravel Artisan Cheatsheet now has an API. Learn more.

model:prune

Prune models that are no longer needed

Options

  • model - Class names of the models to be pruned Optional
  • except - Class names of the models to be excluded from pruning Optional
  • chunk - The number of models to retrieve per chunk of models to be deleted Optional
  • pretend - Display the number of prunable records found instead of deleting them Optional
php artisan model:prune [--model [MODEL]] [--except [EXCEPT]] [--chunk [CHUNK]] [--pretend]