PHPackages                             seedbase/seedbase - 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. seedbase/seedbase

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

seedbase/seedbase
=================

PHP SDK for SeedBase — generate realistic, relationship-preserving, privacy-safe test data and pull it into your database. Includes Laravel and Symfony bridges.

v0.2.0(1mo ago)01MITPHPPHP &gt;=8.1CI passing

Since Jun 10Pushed 1mo agoCompare

[ Source](https://github.com/marcelglaeser/seedbase-php)[ Packagist](https://packagist.org/packages/seedbase/seedbase)[ Docs](https://seedba.se)[ RSS](/packages/seedbase-seedbase/feed)WikiDiscussions master Synced 1w ago

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

 [![SeedBase](https://camo.githubusercontent.com/a726a784a2e205384eb0024bd4c5feb04e816f0bdbc6387cf8c766c7774d6815/68747470733a2f2f7365656462612e73652f73656564626173652d6c6f676f2d3235362e706e67)](https://camo.githubusercontent.com/a726a784a2e205384eb0024bd4c5feb04e816f0bdbc6387cf8c766c7774d6815/68747470733a2f2f7365656462612e73652f73656564626173652d6c6f676f2d3235362e706e67)

SeedBase PHP
============

[](#seedbase-php)

Generate realistic, relationship-preserving, privacy-safe test data for your databases — and pull it straight into your local or CI database. This is the PHP SDK for [seedba.se](https://seedba.se), with first-class bridges for **Laravel** and **Symfony**.

You model (or import) a schema on the platform, generate datasets, and use this package to pull them into Postgres, MySQL, SQLite and more. Schema-aware, foreign-key-correct, reproducible by seed.

Install
-------

[](#install)

```
composer require seedbase/seedbase
```

Requires PHP 8.1+. Uses Guzzle under the hood, so it slots cleanly into Laravel and Symfony apps.

Authentication
--------------

[](#authentication)

The client resolves a token in this order:

1. Constructor argument (`['token' => 'dr_sk_...']`)
2. `SEEDBASE_TOKEN` environment variable
3. `~/.seedbase/config.json` (`{"token": "..."}`)

Secret keys (`dr_sk_...`) are sent as `Authorization: Bearer ...`; legacy tokens as `Authorization: Token ...`. Only `https://` endpoints are accepted (except `localhost`/`127.0.0.1`/`::1`). Create a free account at  (no credit card) and grab a key under Settings → API keys.

Command-line tool
-----------------

[](#command-line-tool)

The package ships a standalone CLI (`bin/seedbase`), mirroring the Python CLI. Install it globally and you get a `seedbase` command on your `PATH`:

```
composer global require seedbase/seedbase
# ensure ~/.composer/vendor/bin (or ~/.config/composer/vendor/bin) is on your PATH

seedbase login                       # browser device-flow, saves a token to ~/.seedbase/config.json (chmod 0600)
seedbase projects                    # list your projects (--json for machine-readable output)
seedbase generate  --seed 42 --rows 100 --wait
seedbase generations     # list a project's generated datasets
seedbase pull  --to-file seed.sql   # download newest completed dataset (atomic .part + rename)
seedbase pull  --generation     # without --to-file, the SQL is printed to stdout
seedbase config                      # show the active API URL and whether a token is set (token is masked)
```

`login` opens your browser, polls until you authorize, and stores the token. Every other command resolves auth like the SDK: `SEEDBASE_TOKEN` env → `~/.seedbase/config.json`. The API URL comes from `SEEDBASE_API_URL` → config → `https://seedba.se/api/v1`. Only `https://` is accepted (except localhost). Errors (including DRF field errors) go to stderr with a non-zero exit code.

(a) Plain PHP
-------------

[](#a-plain-php)

```
use Seedbase\SeedbaseClient;

$client = new SeedbaseClient([
    'token' => 'dr_sk_...',          // optional — see resolution order above
    // 'api_url' => 'https://seedba.se/api/v1',
    // 'request_timeout' => 30,
]);

$projects = $client->listProjects();                 // paginated, fully followed

$generation = $client->generate($projectId, [
    'seed' => 42,
    'wait' => true,                                  // poll until terminal
]);

$sql = $client->download($generation['id'], 'sql');  // raw dump as string
file_put_contents('seed.sql', $sql);
```

### Available methods

[](#available-methods)

MethodDescription`listProjects()`All projects (datasets), pagination followed`getProject($id)`Single project`listGenerations($projectId)`Generations for a project`getGeneration($id)`Single generation`generate($projectId, $options)`Trigger a generation; `['wait' => true]` polls to completion`download($generationId, $format)`Download a generated dataset (default `sql`) as a string`exportConfig($projectId)`Export the engine config`importConfig($projectId, $config)`Import an engine configAll errors throw `Seedbase\SeedbaseException` with a readable message (including DRF field errors from the response body) and an optional HTTP status code via `getStatusCode()`.

(b) Laravel
-----------

[](#b-laravel)

The `SeedbaseServiceProvider` is auto-discovered. Publish the config if you want to tweak it:

```
php artisan vendor:publish --tag=seedbase-config
```

Set your env:

```
SEEDBASE_TOKEN=dr_sk_...
SEEDBASE_PROJECT=your-project-id
SEEDBASE_SEED=42
```

Inject the client anywhere:

```
use Seedbase\SeedbaseClient;

class ImportFixtures
{
    public function __construct(private SeedbaseClient $seedbase) {}

    public function handle(): void
    {
        $gen = $this->seedbase->generate(config('seedbase.project'), ['wait' => true]);
        // ...
    }
}
```

Pull a dataset into your database with the bundled seeder:

```
php artisan db:seed --class="Seedbase\Laravel\SeedbaseSeeder"
```

It triggers a generation, waits for it, downloads the SQL dump and imports it inside a transaction. Use it as a reference and adapt the import step to your schema if needed.

(c) Symfony
-----------

[](#c-symfony)

Register the bundle in `config/bundles.php`:

```
return [
    // ...
    Seedbase\Symfony\SeedbaseBundle::class => ['all' => true],
];
```

Configure it in `config/packages/seedbase.yaml`:

```
seedbase:
    token: '%env(SEEDBASE_TOKEN)%'
    api_url: 'https://seedba.se/api/v1'
    request_timeout: 30
    project: '%env(SEEDBASE_PROJECT)%'
    seed: '%env(int:SEEDBASE_SEED)%'
```

`SeedbaseClient` is now an autowireable service:

```
use Seedbase\SeedbaseClient;

class CatalogImporter
{
    public function __construct(private SeedbaseClient $seedbase) {}
}
```

Load data via a Doctrine fixture (`doctrine/doctrine-fixtures-bundle`). Wire `SeedbaseFixtures` with your project/seed and run:

```
php bin/console doctrine:fixtures:load
```

```
# config/services.yaml
services:
    Seedbase\Symfony\SeedbaseFixtures:
        arguments:
            $projectId: '%seedbase.project%'
            $seed: '%seedbase.seed%'
        tags: ['doctrine.fixture.orm']
```

It triggers a generation, waits, downloads the SQL dump and executes it through the Doctrine connection — adapt the import step to your entities.

Tests
-----

[](#tests)

```
composer install
composer test     # or: vendor/bin/phpunit
```

The test suite mocks Guzzle (no network) and covers token resolution, auth headers, HTTPS enforcement, pagination, error parsing and the generate/wait poll loop.

Links
-----

[](#links)

- Website:
- Docs:
- API keys:

MIT licensed.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance93

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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 ~11 days

Total

2

Last Release

34d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6400771?v=4)[Marcel Gläser](/maintainers/marcelglaeser)[@marcelglaeser](https://github.com/marcelglaeser)

---

Top Contributors

[![marcelglaeser](https://avatars.githubusercontent.com/u/6400771?v=4)](https://github.com/marcelglaeser "marcelglaeser (2 commits)")

---

Tags

symfonylaravelfixturesseederanonymizationtest dataseedbase

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seedbase-seedbase/health.svg)

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

###  Alternatives

[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k4.0k](/packages/leantime-leantime)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k46](/packages/neuron-core-neuron-ai)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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