1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:44:02 +00:00
tenancy/src/Database/Concerns/BelongsToPrimaryModel.php
2022-08-30 05:44:23 +02:00

17 lines
355 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Database\Concerns;
use Stancl\Tenancy\Database\ParentModelScope;
trait BelongsToPrimaryModel
{
abstract public function getRelationshipToPrimaryModel(): string;
public static function bootBelongsToPrimaryModel(): void
{
static::addGlobalScope(new ParentModelScope);
}
}