<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Modules\ModulesProvider as AdminModulesProvider;

class AppServiceProvider extends ServiceProvider
{
    const ADMIN_MODULES = 'admin_modules';

    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        $this->loadViewsFrom(__DIR__ . '/../../src/views', 'common');
        $this->app->singleton(self::ADMIN_MODULES, function ($app) {
            $provider = new AdminModulesProvider();
            $provider->init();
            return $provider;
        });
    }
}
