PHPackages                             topoff/laravel-database-downloader - 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. topoff/laravel-database-downloader

ActiveLibrary

topoff/laravel-database-downloader
==================================

Dumps + Downloads a mysql database from a production server and imports it into the dev environment

v2.0.1(1mo ago)0287—10%[2 PRs](https://github.com/topoff/laravel-database-downloader/pulls)MITPHPPHP ^8.3CI passing

Since Feb 10Pushed 1mo agoCompare

[ Source](https://github.com/topoff/laravel-database-downloader)[ Packagist](https://packagist.org/packages/topoff/laravel-database-downloader)[ Docs](https://github.com/topoff/laravel-database-downloader)[ GitHub Sponsors](https://github.com/topoff)[ RSS](/packages/topoff-laravel-database-downloader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (29)Versions (13)Used By (0)

laravel-database-downloader
===========================

[](#laravel-database-downloader)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e3c15434016d43472a31beb64a82aac24ac6b4a60bb4df040c87db950d5adac1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f706f66662f6c61726176656c2d64617461626173652d646f776e6c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/topoff/laravel-database-downloader)[![GitHub Tests Action Status](https://camo.githubusercontent.com/376803c1df8fd311b8ef8de5e60e624fc3e30c6033adea2632ff411c4859c906/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f706f66662f6c61726176656c2d64617461626173652d646f776e6c6f616465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/topoff/laravel-database-downloader/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/2a401255b875951ab7461b733960b59778b72702e0d9db807b30a1cec508e269/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f706f66662f6c61726176656c2d64617461626173652d646f776e6c6f616465722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/topoff/laravel-database-downloader/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f020d2b7b0482ee101e2849b44d3a297ed2db195ae0b5bff54c1cb2331b344b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f706f66662f6c61726176656c2d64617461626173652d646f776e6c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/topoff/laravel-database-downloader)

This package allows you to easily dump and download a MySQL database from a production or backup server and import it into your local development environment. It also supports downloading files from storage and provides an event-driven way to handle post-import tasks.

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

[](#installation)

You can install the package via composer:

```
composer require topoff/laravel-database-downloader
```

You can publish the config file with:

```
php artisan vendor:publish --tag="database-downloader-config"
```

Usage
-----

[](#usage)

The package provides an interactive command to download and import the database:

```
php artisan db:download
```

You'll be prompted to:

1. **Select the data source**: `backup`, `staging`, or `live`
2. **Select dump type** (if staging or live): `Full dump` or `Only structure`

### Options

[](#options)

- `--dropExisting`: Drop the database before import if it exists.
- `--files`: Download and import files from `public/storage`.
- `--dbName=`: Use a different database name instead of the default.
- `--import-from-local-file-path=`: Import from a specific local file instead of downloading.

### Events

[](#events)

After a successful import, the package dispatches a `Topoff\DatabaseDownloader\Events\DatabaseImported` event. You can listen to this event to perform post-import tasks like data sanitization or environment-specific adjustments.

```
// Optionally Register the Listener in your EventServiceProvider or AppServiceProvider, Laravel does this automatically
Event::listen(
    \Topoff\DatabaseDownloader\Events\DatabaseImported::class,
    \App\Listeners\YourPostImportListener::class,
);
```

The event contains the following properties:

- `filesImported`: A boolean indicating if the `--files` option was used.

Laravel Boost Integration
-------------------------

[](#laravel-boost-integration)

This package is configured to work with [Laravel Boost](https://github.com/laravel/boost) for enhanced AI-assisted development.

Key features:

- ✅ Artisan script for MCP server support
- ✅ WorkbenchServiceProvider with automatic path configuration
- ✅ CLAUDE.md with package-specific guidelines
- ✅ Security best practices and coding standards

For detailed setup and usage instructions, see [BOOST.md](BOOST.md).

Security
--------

[](#security)

This package has been thoroughly reviewed for security vulnerabilities:

- Input validation and sanitization
- Shell command injection prevention
- Path traversal protection
- Secure credential handling

For detailed security information, see [SECURITY.md](SECURITY.md).

Development
-----------

[](#development)

### Code Quality Tools

[](#code-quality-tools)

This package uses several tools to maintain code quality:

#### Laravel Pint (Code Formatting)

[](#laravel-pint-code-formatting)

Format code according to Laravel standards:

```
composer format
```

#### Rector (Automated Refactoring)

[](#rector-automated-refactoring)

Preview potential code improvements:

```
composer rector-dry
```

Apply automated refactorings:

```
composer rector
```

#### PHPStan (Static Analysis)

[](#phpstan-static-analysis)

Run static analysis:

```
composer analyse
```

#### Run All Quality Checks

[](#run-all-quality-checks)

```
composer lint
```

This runs both Pint and PHPStan.

### Testing

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Andreas Berger](https://github.com/andreasberger83)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance90

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.7% 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 ~5 days

Recently: every ~11 days

Total

10

Last Release

53d ago

Major Versions

v1.4.2 → v2.0.02026-03-27

### Community

Maintainers

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

---

Top Contributors

[![ndberg](https://avatars.githubusercontent.com/u/13345669?v=4)](https://github.com/ndberg "ndberg (18 commits)")[![top-offerten](https://avatars.githubusercontent.com/u/61965317?v=4)](https://github.com/top-offerten "top-offerten (1 commits)")

---

Tags

laravel database downloader

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/topoff-laravel-database-downloader/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[wnx/laravel-sends

Keep track of outgoing emails in your Laravel application.

200427.3k](/packages/wnx-laravel-sends)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)

PHPackages © 2026

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