<?php

namespace App\Models\Concerns;

use App\Models\Scopes\NullableBranchScope;

/**
 * For models with a nullable branch_id where NULL means "applies to every
 * branch" (e.g. ProductBundle, Voucher) — see {@see NullableBranchScope}.
 * No create-time auto-stamp: an explicit NULL branch_id is a common,
 * intentional value here, not an omission to default.
 */
trait NullableBranchScoped
{
    public static function bootNullableBranchScoped(): void
    {
        static::addGlobalScope(new NullableBranchScope);
    }
}
