<?php
namespace App\Services;
use App\Models\User;
class OrganizationAccess {
    public static function orgId(User $user): ?int { return $user->isSuperAdmin()?null:$user->organization_id; }
    public static function apply($query, User $user, string $column='organization_id') {
        if (!$user->isSuperAdmin()) $query->where($column,$user->organization_id);
        return $query;
    }
}
