<?php

namespace App\Providers;

use App\Models\Order;
use App\Models\User;
use App\Policies\AdminPolicy;
use App\Policies\OrderPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * @var array<class-string, class-string>
     */
    protected $policies = [
        Order::class => OrderPolicy::class,
    ];

    public function boot(): void
    {
        $this->registerPolicies();

        Gate::define('admin.access', [AdminPolicy::class, 'access']);
        Gate::define('order.manage', [OrderPolicy::class, 'manage']);
    }
}
