mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:34:03 +00:00
Identification middleware & tests
This commit is contained in:
parent
a17727b437
commit
8ea4940f34
18 changed files with 362 additions and 174 deletions
|
|
@ -3,7 +3,7 @@
|
|||
namespace Stancl\Tenancy;
|
||||
|
||||
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||
use Stancl\Tenancy\Database\Models\Tenant;
|
||||
use Stancl\Tenancy\Database\Models\Tenant; // todo contract
|
||||
|
||||
class Tenancy
|
||||
{
|
||||
|
|
@ -18,6 +18,11 @@ class Tenancy
|
|||
|
||||
public function initialize(Tenant $tenant): void
|
||||
{
|
||||
// todo the id is something that should be on the contract, with a method
|
||||
if ($this->initialized && $this->tenant->id === $tenant->id) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->tenant = $tenant;
|
||||
|
||||
$this->initialized = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue