Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Multitenancy Laravel Package

spatie/laravel-multitenancy

Unopinionated multitenancy for Laravel. Detect the current tenant per request and run configurable tasks when switching tenants. Supports single or multiple databases, tenant-aware queued jobs, per-tenant Artisan commands, and easy model connection handling.

View on GitHub
Deep Wiki
Context7
4.2.0

What's Changed

Processing a job no longer leaves the surrounding code with a different current tenant than it had before (#639, #643).

On the sync connection and through dispatchSync(), a job runs inside the request that dispatched it. A job that is not tenant aware forgot the current tenant and never put it back, so the rest of the request continued without one. A tenant aware job for another tenant left that other tenant current. Whatever tenant was current before a job starts is now restored when it finishes, on both the success and the failure path, and nested sync dispatches restore per level.

queue:retry behaves the same way. It needs the tenant of a failed job while it pushes that job back onto the queue, but the tenant of the code that ran the command is restored once it finishes. This matters when retrying jobs from a request with Artisan::call('queue:retry').

Behaviour worth knowing about when upgrading: on a queue worker the tenant of a processed job no longer stays current after that job finishes. Every job binds its own tenant, so jobs are unaffected, but code reading Tenant::current() in between jobs now sees no tenant. Listeners that are part of processing a job, Queue::after() and JobFailed for instance, still see the tenant of the job they are handling.

  • Update actions/checkout to v7 (#644)

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.1.5...4.2.0

4.1.5
4.1.4

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.1.3...4.1.4

4.1.3

What's Changed

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.1.2...4.1.3

4.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.1.0...4.1.1

4.0.9

What's Changed

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.8...4.0.9

4.0.7

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.6...4.0.7

4.0.6

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.5...4.0.6

4.0.5

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.4...4.0.5

4.0.3

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.2...4.0.3

4.0.2

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.1...4.0.2

4.0.1
  • Fix NotTenantAware notifications, mailables, closures, listeners & broadcast events in a default tenant aware application

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/4.0.0...4.0.1

4.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/3.2.0...4.0.0

3.0.0

Breaking change

  • NotTenantAware jobs will now forget any current tenant that might have been set when starting processing.

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.3.9...3.0.0

2.3.9
  • Fix an issue where the Illuminate\Cache\Repository was not being cleared from the container

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.3.8...2.3.9

2.3.8

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.3.7...2.3.8

2.3.7
2.3.6

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.3.5...2.3.6

2.3.5

What's Changed

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.3.4...2.3.5

2.3.2
  • add support for Laravel 9
2.3.1

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.3.0...2.3.1

2.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-multitenancy/compare/2.1.1...2.2.0

2.1.1
  • add filterCurrent and rejectCurrent to TenantCollection (#275)
2.1.0
  • add Laravel Octane support
2.0.0
  • drop support for PHP 7
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle