mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Use of artisan tinker for manual initialization
Small change but it took a bit for me to figure this one out so I wanted to mention it
This commit is contained in:
parent
bfc1c4f513
commit
28e5ad9062
1 changed files with 2 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ section: content
|
|||
|
||||
# Manual initialization {#manual-initialization}
|
||||
|
||||
Sometimes you may want to initialize tenancy manually — that is, not using web middleware, command traits, queue tenancy etc.
|
||||
Sometimes you may want to initialize tenancy manually — that is, not using web middleware, command traits, queue tenancy etc. A common use case for this is if you need to use `artisan tinker` for a specific tenant.
|
||||
|
||||
For that, use the `initialize()` method on `Stancl\Tenancy\Tenancy`. You can resolve the `Tenancy` instance out of the container using the `tenancy()` helper.
|
||||
|
||||
|
|
@ -14,4 +14,4 @@ For that, use the `initialize()` method on `Stancl\Tenancy\Tenancy`. You can res
|
|||
$tenant = Tenant::find('some-id');
|
||||
|
||||
tenancy()->initialize($tenant);
|
||||
```
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue