mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
3.x redesign
This commit is contained in:
parent
857122540f
commit
f8f354c323
229 changed files with 201175 additions and 22440 deletions
17
source/docs/v3/manual-initialization.md
Normal file
17
source/docs/v3/manual-initialization.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: Manual tenancy initialization
|
||||
extends: _layouts.documentation
|
||||
section: 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.
|
||||
|
||||
```php
|
||||
$tenant = Tenant::find('some-id');
|
||||
|
||||
tenancy()->initialize($tenant);
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue