Skip to content

Laravel artisan command to drop all database tables and rerun the migrations.

License

Notifications You must be signed in to change notification settings

sk4t0/laravel-db-clear-command

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Database Tables Clear Command

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

About

Laravel artisan command to drop all database tables and rerun the migrations.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%