abhijitghogre / laravel-db-clear-command
Laravel artisan command to drop all database tables and rerun the migrations.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 11 982
Dependents: 2
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.0
- illuminate/support: ~5.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is not auto-updated.
Last update: 2023-04-01 09:50:43 UTC
README
Laravel artisan command to drop all database tables and rerun the migrations.
Tested with Laravel 5 and Laravel 5.1
Installation and usage
Add composer dependency:
composer require abhijitghogre/laravel-db-clear-command dev-master
Add the service provider in your config/app.php file:
<?php return [ ... 'providers' => [ ... 'Abhijitghogre\LaravelDbClearCommand\LaravelDbClearCommandServiceProvider', ], ];
Run the command
php artisan db:clear
The command switches off foreign key check, drops all the tables and re-runs your migrations.
Optionally, pass
--seed
option to run the seeders post migration
php artisan db:clear --seed