Package Data | |
---|---|
Maintainer Username: | Kreshnik |
Maintainer Contact: | kreshnik.hasanaj@gmail.com (Kreshnik Hasanaj) |
Package Create Date: | 2015-01-30 |
Package Last Update: | 2018-12-05 |
Language: | PHP |
License: | MIT License |
Last Refreshed: | 2025-01-29 15:17:58 |
Package Statistics | |
---|---|
Total Downloads: | 41 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 6 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Automatically truncates all mysql tables for you. Works also with tables that use relationships, by using the FOREIGN_KEY_CHECKS
system variable.
Begin by installing this package through Composer. Edit your project's composer.json
file to require kreshnik/dbtruncate
"require-dev": {
"kreshnik/dbtruncate": "dev-master"
}
"require-dev": {
"kreshnik/dbtruncate": "5.4.x-dev"
}
Next, update Composer from the Terminal:
composer update
Once this operation completes, the final step is to add the service provider. Open config/app.php
, and add a new item to the providers array.
Kreshnik\Dbtruncate\DbtruncateServiceProvider::class
That's it! You're all set to go. Run the artisan
command from the Terminal to see the new db:truncate
command.
php artisan
db:truncate
will prompt you to confirm the truncation process
db:truncate --tables=table1,table2
In case you want to truncate specific tables. You can specify a list of tables divided with a comma.
db:truncate --exclude=table1,table2
A list of tables that will be excluded from the truncation process. The tables have to be divded with a comma.