- Update API: events, users, policies, routes, resources, migrations - Remove deprecated models/resources (customers, setlists, invitations, etc.) - Refresh admin app and docs; remove apps/band Made-with: Cursor
22 lines
494 B
PHP
22 lines
494 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models\Scopes;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Scope;
|
|
|
|
final class OrganisationScope implements Scope
|
|
{
|
|
public function __construct(
|
|
private readonly string $organisationId,
|
|
) {}
|
|
|
|
public function apply(Builder $builder, Model $model): void
|
|
{
|
|
$builder->where($model->getTable() . '.organisation_id', $this->organisationId);
|
|
}
|
|
}
|