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:
parent
553e4c381b
commit
5fb11dfc9f
5 changed files with 74 additions and 4 deletions
15
src/Exceptions/DomainsOccupiedByOtherTenantException.php
Normal file
15
src/Exceptions/DomainsOccupiedByOtherTenantException.php
Normal 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.";
|
||||
}
|
||||
}
|
||||
25
src/Exceptions/TenantWithThisIdAlreadyExistsException.php
Normal file
25
src/Exceptions/TenantWithThisIdAlreadyExistsException.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue