mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
* Add SingleDomainTenant * Add logic for single domain tenants * Test that the single domain approach works (wip) * Fix code style (php-cs-fixer) * Simplify SubdomainTest tests * Add single domain tenant conditions to DomainTenantResolver * Test single domain tenants in resolver test * Fix test name typo * Improve runUsingBothDomainApproaches() * Delete extra tenancy()->end() * Test early identification with both domain approaches * Test that things work with both domain approaches in the rest of the tests * Fix falsely passing test * Fix PHPStan errors * Change SingleDomainTenant to a contract, add SingleDomainTenant test model * Fix TenantList domainsCLI() * Improve setCurrentDomain() check * Fix code style (php-cs-fixer) * Add annotation * Revert getCustomColumns() change * Add comments * Use the domain returned by the closure in runUsingBoth..() * Delete `migrate` from test * Improve test names * Use variable instead of repeating the same string multiple times * Update comment * Add comment * Clean up PreventAccess test * Don't assign domain to a single-use variable * Update comments * Uncomment datasets * Add todo * Fix user impersonation test * Don't specify tenant key when creating tenant in runUsingBoth..() * Improve universal route test * Improve `runUsingBothDomainApproaches()` * Add tests specific to single domain tenants * Get rid of the runUsingBothDomainApproaches method * Add test file specific for the single domain tenant feature * Rename test * Make getCustomColumns() function static * Positiopn datasets differently * Fix early id test * Add prevent MW to route MW in test * Fix single domain tenant tests * Delete SingleDomainTenantTest (CI testing) * Add the test file back * TUrn APP_DEBUG on temporarily * Turn debug off * Try creating tenant with non-unique domain (CI testing) * dd duplicate tenant records * Revert testing change * Make SingleDomainTenant not extend base tenant (VirtualColumn issues) * Fix early id test * add todo * Use dev-master stancl/virtualcolumn * Make SingleDomainTenant extend the tenant base model * remove todo * Clean up EarlyIdentificationTest changes * Finish test file cleanup * Fix test * improve test --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com> Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
29 lines
848 B
PHP
29 lines
848 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Tests\Etc;
|
|
|
|
use Stancl\Tenancy\Contracts;
|
|
use Stancl\Tenancy\Events;
|
|
use Stancl\Tenancy\Database\Concerns;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Stancl\VirtualColumn\VirtualColumn;
|
|
use Stancl\Tenancy\Database\TenantCollection;
|
|
use Stancl\Tenancy\Database\Models\Tenant as BaseTenant;
|
|
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
|
|
use Stancl\Tenancy\Exceptions\TenancyNotInitializedException;
|
|
use Stancl\Tenancy\Contracts\SingleDomainTenant as SingleDomainTenantContract;
|
|
|
|
class SingleDomainTenant extends BaseTenant implements SingleDomainTenantContract, TenantWithDatabase
|
|
{
|
|
use Concerns\ConvertsDomainsToLowercase, Concerns\HasDatabase;
|
|
|
|
public function getCustomColumns(): array
|
|
{
|
|
return [
|
|
'id',
|
|
'domain',
|
|
];
|
|
}
|
|
}
|