mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 16:24:04 +00:00
BelongsToParentModel
This commit is contained in:
parent
28019f4528
commit
42160aa93c
4 changed files with 94 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ trait BelongsToTenant
|
|||
|
||||
public static function bootBelongsToTenant()
|
||||
{
|
||||
static::addGlobalScope(new TenantScope(BelongsToTenant::$tenantIdColumn));
|
||||
static::addGlobalScope(new TenantScope);
|
||||
|
||||
static::creating(function ($model) {
|
||||
if (! $model->getAttribute(BelongsToTenant::$tenantIdColumn) && ! $model->relationLoaded('tenant')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue