mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
Convert domains to lowercase, persist current domain model on resolver
This commit is contained in:
parent
cd1381eae9
commit
02e049b59e
6 changed files with 42 additions and 6 deletions
|
|
@ -7,6 +7,7 @@ namespace Stancl\Tenancy\Tests;
|
|||
use Illuminate\Support\Facades\Route;
|
||||
use Stancl\Tenancy\Database\Concerns\HasDomains;
|
||||
use Stancl\Tenancy\Database\Models;
|
||||
use Stancl\Tenancy\Database\Models\Domain;
|
||||
use Stancl\Tenancy\Exceptions\DomainOccupiedByOtherTenantException;
|
||||
use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedOnDomainException;
|
||||
use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
|
||||
|
|
@ -103,6 +104,18 @@ class DomainTest extends TestCase
|
|||
->get('http://foo.localhost/foo/abc/xyz')
|
||||
->assertSee('foo');
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function domains_are_always_lowercase()
|
||||
{
|
||||
$tenant = DomainTenant::create();
|
||||
|
||||
$tenant->domains()->create([
|
||||
'domain' => 'CAPITALS',
|
||||
]);
|
||||
|
||||
$this->assertSame('capitals', Domain::first()->domain);
|
||||
}
|
||||
}
|
||||
|
||||
class DomainTenant extends Models\Tenant
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue