PHPackages                             kreshnik/dbtruncate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kreshnik/dbtruncate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kreshnik/dbtruncate
===================

A laravel command that helps truncate mysql database tables

5.4.x-dev(8y ago)6411MIT LicensePHPPHP &gt;=5.6.4

Since Oct 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Kreshnik/dbtruncate)[ Packagist](https://packagist.org/packages/kreshnik/dbtruncate)[ RSS](/packages/kreshnik-dbtruncate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel DBTruncate Command
--------------------------

[](#laravel-dbtruncate-command)

Automatically truncates all mysql tables for you. Works also with tables that use relationships, by using the `FOREIGN_KEY_CHECKS` system variable.

Installation
------------

[](#installation)

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `kreshnik/dbtruncate`

#### Laravel 5.5

[](#laravel-55)

```
"require-dev": {
	"kreshnik/dbtruncate": "dev-master"
}

```

#### Laravel 5.4

[](#laravel-54)

```
"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

```

Commands
--------

[](#commands)

`db:truncate` will prompt you to confirm the truncation process

### Options

[](#options)

`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.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b60137c652aedc8d1d80321f50f77ed774b7f3f378f36660b580c1dba4f47c96?d=identicon)[Kreshnik](/maintainers/Kreshnik)

---

Top Contributors

[![Kreshnik](https://avatars.githubusercontent.com/u/1788349?v=4)](https://github.com/Kreshnik "Kreshnik (32 commits)")

---

Tags

composerlaravelmysqlmysql-tablesphptruncatetruncation-processlaraveldbtruncatetables truncate

### Embed Badge

![Health badge](/badges/kreshnik-dbtruncate/health.svg)

```
[![Health](https://phpackages.com/badges/kreshnik-dbtruncate/health.svg)](https://phpackages.com/packages/kreshnik-dbtruncate)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
