<?php

use App\Models\Central\SuperAdmin;
use App\Models\Tenant\User;

return [

    'defaults' => [
        'guard' => env('AUTH_GUARD', 'web'),
        'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
    ],

    'guards' => [
        // Tenant-side auth (per-company users on <slug>.service.mir.md).
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        // Central-side auth (super-admins on service.mir.md/admin).
        'central' => [
            'driver' => 'session',
            'provider' => 'super_admins',
        ],

        // Public storefront customer auth (per-tenant).
        'shop' => [
            'driver' => 'session',
            'provider' => 'shop_customers',
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => env('AUTH_MODEL', User::class),
        ],
        'super_admins' => [
            'driver' => 'eloquent',
            'model' => SuperAdmin::class,
        ],
        'shop_customers' => [
            'driver' => 'eloquent',
            'model' => \App\Models\Tenant\ShopCustomer::class,
        ],
    ],

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
            'expire' => 60,
            'throttle' => 60,
        ],
        'super_admins' => [
            'provider' => 'super_admins',
            'table' => 'password_reset_tokens',
            'expire' => 60,
            'throttle' => 60,
        ],
        'shop_customers' => [
            'provider' => 'shop_customers',
            'table' => 'password_reset_tokens',
            'expire' => 60,
            'throttle' => 60,
        ],
    ],

    'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),

];
