<?php

namespace App\Providers;

use App\Models\ActionLog;
use App\Models\EmailTemplate;
use App\Models\Media;
use App\Models\Menu;
use App\Models\Module;
use App\Models\Post;
use App\Models\Setting;
use App\Models\Term;
use App\Models\User;
use App\Policies\ActionLogPolicy;
use App\Policies\EmailTemplatePolicy;
use App\Policies\MediaPolicy;
use App\Policies\MenuPolicy;
use App\Policies\ModulePolicy;
use App\Policies\PermissionPolicy;
use App\Policies\PostPolicy;
use App\Policies\RolePolicy;
use App\Policies\SettingPolicy;
use App\Policies\TermPolicy;
use App\Policies\UserPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The policy mappings for the application.
     *
     * @var array<class-string, class-string>
     */
    protected $policies = [
        User::class => UserPolicy::class,
        Post::class => PostPolicy::class,
        Role::class => RolePolicy::class,
        Permission::class => PermissionPolicy::class,
        Term::class => TermPolicy::class,
        Media::class => MediaPolicy::class,
        Menu::class => MenuPolicy::class,
        Setting::class => SettingPolicy::class,
        EmailTemplate::class => EmailTemplatePolicy::class,
        Module::class => ModulePolicy::class,
        ActionLog::class => ActionLogPolicy::class,
    ];

    /**
     * Register any authentication / authorization services.
     */
    public function boot(): void
    {
        $this->registerPolicies();
    }
}
