finds.dev← search

// the find

orchestral/tenanti

★ 588 · PHP · MIT · updated Jun 2023

[Package] Multi-tenant Database Schema Manager for Laravel

Tenanti is a Laravel package for managing per-tenant database migrations, supporting both shared-database (prefixed tables) and separate-database-per-tenant models. It's for Laravel shops that need to run schema changes across many tenants without writing their own migration loop. The orchestral ecosystem package, so it follows the same conventions as the rest of that suite.

The dual-mode design (shared vs. separate connection) is genuinely useful — most multi-tenancy packages force one or the other. The queue-based bulk migration command (`tenanti:queue`) is a practical necessity for large tenant counts and it's included out of the box, not an afterthought. The `Tenantor` value object cleanly separates the concept of 'tenant identity' from the Eloquent model, which makes the connection resolver testable. Test coverage looks real — unit tests per command, migrator, and job rather than a single integration smoke test.

Last pushed June 2023, and the version table stops at Laravel 8 — it's at least two major Laravel versions behind with no sign of a 10.x or 11.x branch. The Eloquent Observer approach for hooking tenant lifecycle events is fragile: it fires on every model event including mass-assignment and soft-deletes, which creates surprising side effects if you're not careful. The shared-database mode uses classmap autoloading for migration files rather than PSR-4, which is a 2015-era pattern that breaks with modern Composer optimization. There's no built-in solution for seeding or rolling back a single tenant in isolation — you'd have to pass `--tenant-id` style filters yourself.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →