Laravel artisan command to drop all database tables and rerun the migrations.
Tested with Laravel 5 and Laravel 5.1
Add composer dependency:
composer require abhijitghogre/laravel-db-clear-command dev-masterAdd the service provider in your config/app.php file:
<?php
return [
...
'providers' => [
...
'Abhijitghogre\LaravelDbClearCommand\LaravelDbClearCommandServiceProvider',
],
];Run the command
php artisan db:clearThe command switches off foreign key check, drops all the tables and re-runs your migrations.
Optionally, pass
--seedoption to run the seeders post migration
php artisan db:clear --seed