Initial commit

This commit is contained in:
2025-08-01 22:04:00 +02:00
commit d1f466d1d4
155 changed files with 15995 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace App\Services;
use App\Models\Contracts\BelongsToUser;
use App\Models\Scopes\UserScope;
use Illuminate\Database\Eloquent\Model;
final class UserScopeApplier
{
private bool $enabled = false;
public function enable(): void
{
$this->enabled = true;
}
public function applyScope(Model $model): void
{
if ($this->enabled && $model instanceof BelongsToUser) {
$model->addGlobalScope(new UserScope());
}
}
}