mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 09:44:03 +00:00
Add tenancy()->central() helper (#526)
* Add tenancy()->central() helper * Apply fixes from StyleCI * Add docblock * Fix return typehint Co-authored-by: stancl <stancl@users.noreply.github.com>
This commit is contained in:
parent
dd1b7fc86d
commit
8f34a733d8
3 changed files with 79 additions and 0 deletions
|
|
@ -8,6 +8,13 @@ use Stancl\Tenancy\Contracts\Tenant;
|
|||
|
||||
trait TenantRun
|
||||
{
|
||||
/**
|
||||
* Run a callback in this tenant's context.
|
||||
* Atomic, safely reverts to previous context.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return mixed
|
||||
*/
|
||||
public function run(callable $callback)
|
||||
{
|
||||
/** @var Tenant $this */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue