PHPackages                             kirilldakhniuk/dead-drop - 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. kirilldakhniuk/dead-drop

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

kirilldakhniuk/dead-drop
========================

Export and import your database tables with fake data

v0.3.3(5mo ago)04.8k↓71.8%MITPHPPHP ^8.2

Since Jan 7Pushed 5mo agoCompare

[ Source](https://github.com/kirilldakhniuk/dead-drop)[ Packagist](https://packagist.org/packages/kirilldakhniuk/dead-drop)[ Docs](https://github.com/kirilldakhniuk/dead-drop)[ RSS](/packages/kirilldakhniuk-dead-drop/feed)WikiDiscussions main Synced 4d ago

READMEChangelogDependencies (11)Versions (6)Used By (0)

Dead Drop
=========

[](#dead-drop)

Export and import database tables with fake data. Share database dumps without exposing real user information.

Features
--------

[](#features)

- Export tables to SQL with upsert syntax
- Replace sensitive data with Faker-generated values
- Cloud storage support (S3, DigitalOcean Spaces)
- Works with SQLite, MySQL, and PostgreSQL

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

[](#installation)

```
composer require kirilldakhniuk/dead-drop
```

Publish the config and migrations:

```
php artisan vendor:publish --tag=dead-drop-config
php artisan vendor:publish --tag=dead-drop-migrations
php artisan migrate
```

Basic Usage
-----------

[](#basic-usage)

```
# Export data
php artisan dead-drop:export

# Import data
php artisan dead-drop:import
```

The commands are interactive. To specify a database connection:

```
php artisan dead-drop:export --connection=mysql
php artisan dead-drop:import --connection=tenant_db
```

Date Filtering
--------------

[](#date-filtering)

Filter exports by date range interactively:

```
Export all configured tables? (yes/no) [no]:
> yes

Filter by date range?
  Today
  Yesterday
  Last 7 days
  Last 30 days
> Custom interval

Filter from date (optional):
Examples: 2024-01-01, last month, 30 days ago, yesterday
> last month

Filter to date (optional):
> yesterday

```

Custom intervals support natural language dates via Carbon.

Facade API
----------

[](#facade-api)

```
use KirillDakhniuk\DeadDrop\Facades\DeadDrop;

// Simple export
DeadDrop::export('users');

// With date range
DeadDrop::export('users', [
    'where' => [
        ['created_at', '>=', '2024-01-01'],
        ['created_at', '=', now()->subMonth()->toDateTimeString()],
    ]
]);

// Nova/Filament integration
public function handle()
{
    $result = DeadDrop::export('users', [
        'where' => [
            ['created_at', '>=', $this->startDate],
        ]
    ]);

    return Action::download($result['file']);
}
```

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

[](#configuration)

Edit `config/dead-drop.php`:

```
return [
    'output_path' => storage_path('app/dead-drop'),

    'tables' => [
        'users' => [
            'columns' => ['id', 'name', 'email', 'created_at'],
            'censor' => ['email'],
            'defaults' => ['password' => 'password'], // Auto-hashed with bcrypt
            'where' => [['created_at', '>', now()->subDays(30)]],
            'limit' => 1000,
        ],
    ],
];
```

### Options

[](#options)

```
'tables' => [
    'table_name' => [
        'columns' => ['id', 'name', 'email'], // or '*' for all
        'censor' => ['email', 'phone'],
        'defaults' => ['password' => 'secret'],
        'where' => [
            ['status', '=', 'active'],
            ['created_at', '>', now()->subYear()],
        ],
        'order_by' => 'created_at DESC',
        'limit' => 1000,
    ],

    // Disable a table
    'logs' => false,
],
```

Data Anonymization
------------------

[](#data-anonymization)

List fields to anonymize:

```
'users' => [
    'columns' => '*',
    'censor' => ['email', 'phone', 'address'],
],
```

The package auto-detects common fields and applies appropriate Faker methods:

FieldFaker MethodExampleemailsafeEmailnamenameJane DoephonephoneNumber(555) 123-4567addressaddress123 Main StcitycityNew Yorkipipv4192.168.1.1Auto-detected fields include: email, name, first\_name, last\_name, phone, address, city, state, zip, country, company, job\_title, website, url, ip, ssn, credit\_card, and more.

### Custom Faker Methods

[](#custom-faker-methods)

Specify the Faker method for more control:

```
'censor' => [
    'email' => 'companyEmail',
    'bio' => 'paragraph',
    'website' => 'domainName',
],
```

See all available methods at [fakerphp.github.io](https://fakerphp.github.io/formatters/).

Upsert Support
--------------

[](#upsert-support)

Exports use upsert syntax for safe re-imports:

- **SQLite**: `INSERT OR REPLACE`
- **MySQL**: `INSERT ... ON DUPLICATE KEY UPDATE`
- **PostgreSQL**: `INSERT ... ON CONFLICT DO UPDATE`

Default Values
--------------

[](#default-values)

For partial column exports, add defaults for required fields:

```
'users' => [
    'columns' => ['id', 'name', 'email'],
    'defaults' => ['password' => 'password'],
],
```

Password fields are automatically hashed with bcrypt.

Cloud Storage
-------------

[](#cloud-storage)

Configure cloud uploads in `.env`:

```
DEAD_DROP_STORAGE_DISK=s3
DEAD_DROP_STORAGE_PATH=database-exports
DEAD_DROP_DELETE_LOCAL=false

AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket
```

Install the AWS SDK:

```
composer require league/flysystem-aws-s3-v3 "^3.0"
```

### DigitalOcean Spaces

[](#digitalocean-spaces)

Add to `config/filesystems.php`:

```
'spaces' => [
    'driver' => 's3',
    'key' => env('DO_SPACES_KEY'),
    'secret' => env('DO_SPACES_SECRET'),
    'region' => env('DO_SPACES_REGION', 'nyc3'),
    'bucket' => env('DO_SPACES_BUCKET'),
    'endpoint' => env('DO_SPACES_ENDPOINT'),
],
```

Configure in `.env`:

```
DEAD_DROP_STORAGE_DISK=spaces
DO_SPACES_KEY=your-key
DO_SPACES_SECRET=your-secret
DO_SPACES_REGION=nyc3
DO_SPACES_BUCKET=your-bucket
DO_SPACES_ENDPOINT=https://nyc3.digitaloceanspaces.com
```

Programmatic Usage
------------------

[](#programmatic-usage)

```
use KirillDakhniuk\DeadDrop\Exporter;
use KirillDakhniuk\DeadDrop\Importer;

// Export
$exporter = app(Exporter::class);
$result = $exporter->exportTable('users', 'mysql', storage_path('app/exports'));

// Import
$importer = app(Importer::class);
$result = $importer->importFromFile('/path/to/file.sql', 'mysql');
$result = $importer->importFromCloud('backups/users.sql', 's3', 'mysql');
```

Troubleshooting
---------------

[](#troubleshooting)

**NOT NULL constraint errors** - Add defaults for required fields you're not exporting.

**Foreign key constraint errors** - Import parent tables first, or disable foreign key checks temporarily.

**Duplicate entry errors** - This shouldn't happen with Dead Drop exports since they use upsert syntax. External SQL files may cause this.

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

[](#requirements)

- PHP 8.2+
- Laravel 11.x

License
-------

[](#license)

MIT

---

Created by [Kirill Dakhniuk](https://github.com/kirilldakhniuk)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance72

Regular maintenance activity

Popularity23

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Every ~6 days

Total

5

Last Release

157d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f4d4b3604c3bd224e38524f4c17b44137ece89dae56aa629af34fec31454851?d=identicon)[Kirill Dakhniuk](/maintainers/Kirill%20Dakhniuk)

---

Top Contributors

[![kirilldakhniuk](https://avatars.githubusercontent.com/u/21340376?v=4)](https://github.com/kirilldakhniuk "kirilldakhniuk (6 commits)")

---

Tags

phplaravelfakerdatabasebackupexportsqlimportgdprprivacyanonymization

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kirilldakhniuk-dead-drop/health.svg)

```
[![Health](https://phpackages.com/badges/kirilldakhniuk-dead-drop/health.svg)](https://phpackages.com/packages/kirilldakhniuk-dead-drop)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

492.9k](/packages/itpathsolutions-dbstan)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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