1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-15 18:34:03 +00:00
tenancy/src/Database/Concerns/BelongsToPrimaryModel.php
2020-05-22 09:01:31 +00:00

17 lines
349 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()
{
static::addGlobalScope(new ParentModelScope);
}
}