mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 18:24:03 +00:00
* chore: (Improve documentation search for V3) * fix: checks for mispelled words * fix: mispelled words * fix spaces and syntax * Update multi-database-tenancy.blade.md Co-authored-by: Samuel Stancl <samuel.stancl@gmail.com>
512 B
512 B
| title | extends | section |
|---|---|---|
| Manual tenancy initialization | _layouts.documentation | content |
Manual initialization
Sometimes you may want to initialize tenancy manually — that is, not using web middleware, command traits, queue tenancy etc.
For that, use the initialize() method on Stancl\Tenancy\Tenancy. You can resolve the Tenancy instance out of the container using the tenancy() helper.
$tenant = Tenant::find('some-id');
tenancy()->initialize($tenant);