1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 05:24:03 +00:00

DB driver ensureTenantCanBeCreated

This commit is contained in:
Samuel Štancl 2019-09-15 11:50:19 +02:00
parent 553e4c381b
commit 5fb11dfc9f
5 changed files with 74 additions and 4 deletions

View file

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
class DomainOccupiedByOtherTenantException extends TenantCannotBeCreatedException
{
public function reason(): string
{
return "One or more of the tenant's domains are already occupied by another tenant.";
}
}

View file

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
class TenantWithThisIdAlreadyExistsException extends TenantCannotBeCreatedException
{
/** @var string */
protected $id;
public function reason(): string
{
return "Tenant with id {$this->id} already exists.";
}
public function __construct(string $id)
{
parent::__construct();
$this->id = $id;
}
}