mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 04:04:04 +00:00
Identification middleware & tests
This commit is contained in:
parent
a17727b437
commit
8ea4940f34
18 changed files with 362 additions and 174 deletions
15
src/Exceptions/DomainOccupiedByOtherTenantException.php
Normal file
15
src/Exceptions/DomainOccupiedByOtherTenantException.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class DomainOccupiedByOtherTenantException extends Exception
|
||||
{
|
||||
public function __construct($domain)
|
||||
{
|
||||
parent::__construct("The $domain domain is occupied by another tenant.");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Stancl\Tenancy\Contracts\TenantCannotBeCreatedException;
|
||||
|
||||
class DomainsOccupiedByOtherTenantException extends TenantCannotBeCreatedException
|
||||
{
|
||||
public function reason(): string
|
||||
{
|
||||
return "One or more of the tenant's domains are already occupied by another tenant.";
|
||||
}
|
||||
}
|
||||
13
src/Exceptions/NotASubdomainException.php
Normal file
13
src/Exceptions/NotASubdomainException.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class NotASubdomainException extends Exception
|
||||
{
|
||||
public function __construct(string $hostname)
|
||||
{
|
||||
parent::__construct("Hostname $hostname does not include a subdomain.");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue