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


Prune models that are no longer needed


  • model - Class names of the models to be pruned Optional
  • except - Class names of the models to be excluded from pruning Optional
  • path - Absolute path(s) to directories where models are located 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]] [--path [PATH]] [--chunk [CHUNK]] [--pretend]