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 yesterday

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 31% 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

3183d 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.1k](/packages/venturedrake-laravel-crm)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)

PHPackages © 2026

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