PHPackages                             tomshaw/laravel-database-export - 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. tomshaw/laravel-database-export

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

tomshaw/laravel-database-export
===============================

A Laravel database export console command.

v0.2.1(2mo ago)1529[4 PRs](https://github.com/tomshaw/laravel-database-export/pulls)MITPHPPHP ^8.3|^8.4|^8.5CI passing

Since Nov 11Pushed 2mo ago1 watchersCompare

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

READMEChangelog (2)Dependencies (5)Versions (9)Used By (0)

Laravel Database Export 💾
=========================

[](#laravel-database-export-)

[![GitHub Workflow Status](https://camo.githubusercontent.com/ff833c1fa7369937d6bf9a1ee85ef1ae59e5bf114caa3efe081731ad8a8b243c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72742f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://camo.githubusercontent.com/ff833c1fa7369937d6bf9a1ee85ef1ae59e5bf114caa3efe081731ad8a8b243c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72742f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d7465737473)[![issues](https://camo.githubusercontent.com/9682774be86e7da8592d2809f3d76465579f6eb260fcc5566768dca8b4ed3b40/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72743f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://camo.githubusercontent.com/9682774be86e7da8592d2809f3d76465579f6eb260fcc5566768dca8b4ed3b40/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72743f7374796c653d666c6174266c6f676f3d6170707665796f72)[![forks](https://camo.githubusercontent.com/634bacada8828ace87ca41b87fa0171ae8141ddf5fdf1b942246199b9499b41d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72743f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://camo.githubusercontent.com/634bacada8828ace87ca41b87fa0171ae8141ddf5fdf1b942246199b9499b41d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72743f7374796c653d666c6174266c6f676f3d6170707665796f72)[![stars](https://camo.githubusercontent.com/4816935d3e58fed22e9509297aa63da0cf9fda7a056c59bb335f6385922d416d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72743f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://camo.githubusercontent.com/4816935d3e58fed22e9509297aa63da0cf9fda7a056c59bb335f6385922d416d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f746f6d736861772f6c61726176656c2d64617461626173652d6578706f72743f7374796c653d666c6174266c6f676f3d6170707665796f72)[![GitHub license](https://camo.githubusercontent.com/f44aea5273215e06e57e19549aa6bbd226386b470cf062576bad2fc8eac0a0e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f746f6d736861772f6c61726176656c2d64617461626173652d6578706f7274)](https://github.com/tomshaw/laravel-database-export/blob/master/LICENSE)

A Laravel database export console command. Supports MySQL, PostgreSQL and SQL Server.

Requirements
------------

[](#requirements)

- PHP 8.3, 8.4, or 8.5
- Laravel 12

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

[](#installation)

You can install the package via composer:

```
composer require tomshaw/laravel-database-export
```

Usage
-----

[](#usage)

You can use the command like this:

```
php artisan db:export
```

You can also provide a password for the zip file:

```
php artisan db:export --password=yourpassword
```

Configuration
-------------

[](#configuration)

The command uses the following configuration keys:

- `database-export.disks.backup_filename`: The base filename for the backup.
- `database-export.disks.backup_directory`: The directory where the backup files will be stored.

Description
-----------

[](#description)

The `Database Export` command does the following:

1. Checks if the `ZipArchive` class is available.
2. Retrieves the database connection details from the environment variables.
3. Builds the command to export the database based on the database connection.
4. Executes the command and saves the output to a file.
5. Creates a zip file and adds the output file to it.
6. Deletes the output file.
7. Prints a success message.

Support
-------

[](#support)

If you have any issues or questions, please open an issue on the GitHub repository.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). See [License File](LICENSE) for more information.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance86

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76% 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

Every ~416 days

Total

3

Last Release

85d ago

PHP version history (2 changes)v0.1.0PHP ^8.1

v0.2.0PHP ^8.3|^8.4|^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/14fd02efdbaf6247b61c9846697c86dabcbf430374aeff0d80e509d95d186658?d=identicon)[Tom Shaw](/maintainers/Tom%20Shaw)

---

Top Contributors

[![tomshaw](https://avatars.githubusercontent.com/u/32818?v=4)](https://github.com/tomshaw "tomshaw (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

consolelaraveldatabaseartisanexporter

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tomshaw-laravel-database-export/health.svg)

```
[![Health](https://phpackages.com/badges/tomshaw-laravel-database-export/health.svg)](https://phpackages.com/packages/tomshaw-laravel-database-export)
```

###  Alternatives

[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)[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)[boaideas/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

1610.7k](/packages/boaideas-laravel-cli-create-user)[maxim-oleinik/blade-migrations-laravel

An intelligent alternative version of Laravel Database Migrations - uses raw-sql syntax, transactions, auto-rollback, UP-DOWN-UP testing

242.3k](/packages/maxim-oleinik-blade-migrations-laravel)

PHPackages © 2026

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