PHPackages                             nobodyiscertain/laravel-db-commands - 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. [Database &amp; ORM](/categories/database)
4. /
5. nobodyiscertain/laravel-db-commands

ActiveLibrary[Database &amp; ORM](/categories/database)

nobodyiscertain/laravel-db-commands
===================================

A set of Artisan commands to help with database tasks.

v1.0.0(10y ago)12.2k1[1 PRs](https://github.com/nobodyiscertain/laravel-db-commands/pulls)MITPHPCI passing

Since Jan 22Pushed 3mo agoCompare

[ Source](https://github.com/nobodyiscertain/laravel-db-commands)[ Packagist](https://packagist.org/packages/nobodyiscertain/laravel-db-commands)[ RSS](/packages/nobodyiscertain-laravel-db-commands/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Laravel DB Commands
===================

[](#laravel-db-commands)

Here are few Artisan commands to help with common database tasks. This package currently handles:

- [Pulling the Database](#pulling-the-database)
- [Preparing the Test Database](#preparing-the-test-database)
- [Backing up the Database](#backing-up-the-database)

*Note: Currently, this package only supports MySQL. Should you have a need for a different database driver, please open an issue or feel free to fork and pull request away.*

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

[](#installation)

Install with Composer:

```
composer require nobodyiscertain/laravel-db-commands

```

Add service provider to config/app.php:

```
Nobodyiscertain\DbCommands\DbCommandsServiceProvider::class

```

On the command line, run:

```
php artisan vendor:publish

```

This will publish the config file `laravel-db-commands.php` to your config directory. You will need to configure that to match your setup and you should be good to go! Details on the configuration for each of the commands can be found below.

Pulling the Database
--------------------

[](#pulling-the-database)

This command makes it a snap to pull a database dump from a specific environment. After you have it configured, a simple `php artisan db:pull production` will pull the production database and import it locally.

#### How to Run

[](#how-to-run)

```
php artisan db:pull

```

`db_connection_name`: Pass in the name of the connection used in your `config/database.php` that you'd like to pull.

#### Configuration

[](#configuration)

`dbpull_auto_import`: If you would like the database to be auto imported locally after it's pulled, set this to true, otherwise, false.

`dbpull_local_db_conn`: Set this to the name of your local db connection you'd like the dump imported to.

`dbpull_dump_destination`: Set this to a local path you'd like the dump to be stored. I generally use `/tmp` so it'll get wiped.

Preparing the Test Database
---------------------------

[](#preparing-the-test-database)

This command saves the hassle of typing the lengthy artisan command to refresh the testing database and, optionally, run the seeds. Inspried by a similar command in Rails.

#### How to Run

[](#how-to-run-1)

```
php artisan db:test-prepare

```

#### Configuration

[](#configuration-1)

`testing_db_connection`: Set this to the name of the testing database connection configured in `config/database.php`.

`testing_run_seeds`: If you'd like to run the seeds after the database is refreshed, set this to true, otherwise, false.

Backing up the Database
-----------------------

[](#backing-up-the-database)

This command will pull a database dump and upload it to a configured filesystem location. It's great for making one off backups or scheduling with Artisan to make automated backups a breeze.

#### How to Run

[](#how-to-run-2)

```
php artisan db:backup

```

#### Configuration

[](#configuration-2)

`backup_db_conn`: This is the name of database connection in `config/database.php` you'd like to backup. Keep in mind the context of where this command will run. If it's going to be run on the a prodcution server, then most likely it'll be your default `mysql` connection.

`backup_dump_destination`: A local filepath to store the database dump. If on a UNIX-based system, `/tmp` works great.

`backup_disk`: This is the disk name from `config/filesystems.php` that you'd like to permanently store the database dump.

If you'd like to setup automated backups, drop in something like this into `app/Console/Kernal.php`.

```
$schedule->command('db:backup')->twiceDaily();
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance54

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

3764d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3429729eff764fb966b339b604d25864e1d58c02ec991eb419398ea14aff5b3d?d=identicon)[nobodyiscertain](/maintainers/nobodyiscertain)

---

Top Contributors

[![nobodyiscertain](https://avatars.githubusercontent.com/u/71233?v=4)](https://github.com/nobodyiscertain "nobodyiscertain (9 commits)")

---

Tags

laraveldatabaseartisan

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nobodyiscertain-laravel-db-commands/health.svg)

```
[![Health](https://phpackages.com/badges/nobodyiscertain-laravel-db-commands/health.svg)](https://phpackages.com/packages/nobodyiscertain-laravel-db-commands)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[nwidart/db-exporter

Export your database quickly and easily as a Laravel Migration and all the data as a Seeder class.

37839.1k](/packages/nwidart-db-exporter)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[elimuswift/db-exporter

Export your database quickly and easily as a Laravel Migration and all the data as a Seeder class.

364.7k](/packages/elimuswift-db-exporter)

PHPackages © 2026

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