From 87916bd8e583c37d4bbaed3836efc6b98959a504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 6 Sep 2019 18:59:40 +0200 Subject: [PATCH] Save makes the Tenant instance persisted --- src/TenancyServiceProvider.php | 1 + src/Tenant.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/TenancyServiceProvider.php b/src/TenancyServiceProvider.php index 849c071f..b03c0a7d 100644 --- a/src/TenancyServiceProvider.php +++ b/src/TenancyServiceProvider.php @@ -89,6 +89,7 @@ class TenancyServiceProvider extends ServiceProvider }); } + // todo should this be a tenancybootstrapper? public function makeQueuesTenantAware() { $this->app['queue']->createPayloadUsing(function () { diff --git a/src/Tenant.php b/src/Tenant.php index f5447378..ce6b74bb 100644 --- a/src/Tenant.php +++ b/src/Tenant.php @@ -6,6 +6,8 @@ namespace Stancl\Tenancy; use ArrayAccess; +// todo tenant storage + /** * @internal Class is subject to breaking changes in minor and patch versions. */ @@ -85,6 +87,8 @@ class Tenant implements ArrayAccess, Contracts\Tenant $this->manager->updateTenant($this); } + $this->persisted = true; + return $this; }