<?php

namespace App\Modules\Quotes;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Illuminate\Support\Facades\Event;
use App\Modules\Admin\Menu;

class ServiceProvider extends BaseServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // Load the routes for this module
        if (!$this->app->routesAreCached()) {
            require __DIR__ . '/routes.php';
        }

        // Load the views for this module
        $this->loadViewsFrom(__DIR__ . '/views', 'quotes');

        // Register the admin menu item
        $this->registerAdminMenu();
    }

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

    /**
     * Register the admin menu item.
     *
     * @return void
     */
    private function registerAdminMenu()
    {
        // Register the menu item with the Admin Menu
        Menu::register(
            'Quote of the Day',
            url('admin/general/quote-of-the-day'),
            'fa-quote-left',
            'main'
        );
    }
}