mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
17 lines
430 B
PHP
17 lines
430 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
use App\Models\Scopes\VisibleThroughAccessGrants;
|
|
use App\Services\Access\AccessResolver;
|
|
|
|
trait ScopedByAccessGrants
|
|
{
|
|
public static function bootScopedByAccessGrants(): void
|
|
{
|
|
static::addGlobalScope(new VisibleThroughAccessGrants);
|
|
static::created(fn () => app(AccessResolver::class)->flush());
|
|
static::deleted(fn () => app(AccessResolver::class)->flush());
|
|
}
|
|
}
|