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

Shared users - complete

This commit is contained in:
Samuel Štancl 2020-05-12 01:54:02 +02:00
parent daae67c0f7
commit b7c8f1fba7
12 changed files with 488 additions and 56 deletions

View file

@ -3,12 +3,13 @@
namespace Stancl\Tenancy\Contracts;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
// todo rename?
/**
* @property-read Tenant[]|Collection $tenants
*/
interface SyncMaster extends Syncable
{
public function tenants(); // Probably should return BelongsToMany
}
public function tenants(): BelongsToMany;
public function getTenantModelName(): string;
}

View file

@ -2,11 +2,10 @@
namespace Stancl\Tenancy\Contracts;
// todo add comments
interface Syncable
{
public function getGlobalIdentifierKeyName(): string;
public function getGlobalIdentifierKey(): string;
public function getCentralModelName(): string;
public function getSyncedAttributeNames(): array;
}
}

View file

@ -4,12 +4,12 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
use Stancl\Tenancy\Database\Models\Tenant;
use Illuminate\Database\Eloquent\Model;
interface UniqueIdentifierGenerator
{
/**
* Generate a unique identifier.
*/
public static function generate(Tenant $tenant): string;
public static function generate(Model $model): string;
}