dskripchenko/laravel-schemify

Schemify database manager for PostgreSQL — dynamic multi-schema "layer" connections with per-layer migrate / seed / wipe via a --layer option.

Maintainers

Package info

github.com/dskripchenko/laravel-schemify

pkg:composer/dskripchenko/laravel-schemify

Transparency log

Statistics

Installs: 316

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v3.4.2 2026-08-05 09:36 UTC

This package is auto-updated.

Last update: 2026-08-05 09:37:32 UTC


README

🌐 English · Русский · Deutsch · 中文

Dynamic multi-schema PostgreSQL connections for Laravel. Schemify models each PostgreSQL schema as a layer (a layer_items row pointing at a db_connections row) and adds a --layer option to Laravel's migrate, db:seed and db:wipe commands so you can run them against any layer's schema on the fly. Layers can live in the same database (different schemas) or in entirely different databases.

Packagist Tests License

Schemify is a lightweight schema/connection switcher wired into the migration commands — not a full tenancy framework. If you need automatic tenant identification, cache/queue/filesystem isolation or single-DB row scoping, reach for stancl/tenancy or spatie/laravel-multitenancy.

Supported versions

Versions
PHP 8.2 · 8.3 · 8.4 · 8.5
Laravel 11 · 12 · 13
Database PostgreSQL

Install

composer require dskripchenko/laravel-schemify
php artisan layers:install

The provider is auto-discovered. layers:install publishes the config and core migration, creates the db_connections / layer_items tables on the central connection, and registers the default main layer.

Quick tour

php artisan layers:new acme --schema=acme --migrate   # create a layer + schema, run tenant migrations
php artisan migrate --layer=acme                      # migrate a single layer
php artisan layers:list                               # list layers
use Dskripchenko\Schemify\Facades\Schemify;

$total = Schemify::use('acme', fn () => Invoice::sum('amount'));

Documentation

Upgrading from 2.x? See UPGRADE.md and the CHANGELOG.

License

MIT © Denis Skripchenko