<?php

namespace $NAMESPACE$;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;

class $CLASS$ extends ServiceProvider
{
    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');

        $this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');

        $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', '$LOWER_NAME$');

        $this->publishes([
            __DIR__ . '/../../publishable/assets' => public_path('$LOWER_NAME$/assets'),
        ], 'public');

        $this->loadViewsFrom(__DIR__ . '/../Resources/views', '$LOWER_NAME$');

        Event::listen('admin.layout.head', function($viewRenderEventManager) {
            $viewRenderEventManager->addTemplate('$LOWER_NAME$::layouts.style');
        });
    }

    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        $this->registerConfig();
    }

    /**
     * Register package config.
     *
     * @return void
     */
    protected function registerConfig()
    {
        $this->mergeConfigFrom(
            dirname(__DIR__) . '/Config/menu.php', 'menu.admin'
        );

        $this->mergeConfigFrom(
            dirname(__DIR__) . '/Config/acl.php', 'acl'
        );
    }
}