<?php

declare(strict_types=1);

namespace Maestro\Core\Support;

use Illuminate\Auth\AuthManager;
use Maestro\Core\Database\Seeders\UserSeeder;
use Maestro\Core\Models\User;

/**
 * Spatie permission/role pivot guard name ({@see UserSeeder}).
 * Matches {@see User::guardName()}.
 *
 * Laravel overwrites ``auth.defaults.guard`` when ``auth:sanctum`` runs (see
 * {@see AuthManager::setDefaultDriver()}). Deriving Spatie's guard from that config
 * would look up permissions under e.g. ``sanctum`` while rows are stored as ``web``, so checks would silently fail.
 * Maestro CORE always stores abilities under ``web``.
 */
final class PermissionGuardName
{
    public static function forApp(): string
    {
        return 'web';
    }
}
