fimedinet/escudero

View on GitHub
src/EscuderoServiceProvider.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace FimediNET\Escudero;

use Illuminate\Support\ServiceProvider;

class EscuderoServiceProvider extends ServiceProvider
{
    /**
     * Perform post-registration booting of services.
     *
     * @return void
     */
    public function boot()
    {
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'fimedinet');
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'fimedinet');
        // $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
        // $this->loadRoutesFrom(__DIR__.'/routes.php');

        // Publishing is only necessary when using the CLI.
        if ($this->app->runningInConsole()) {

            // Publishing the configuration file.
            $this->publishes([
                __DIR__.'/../config/escudero.php' => config_path('escudero.php'),
            ], 'escudero.config');

            // Publishing the views.
            /*$this->publishes([
                __DIR__.'/../resources/views' => base_path('resources/views/vendor/fimedinet'),
            ], 'escudero.views');*/

            // Publishing assets.
            /*$this->publishes([
                __DIR__.'/../resources/assets' => public_path('vendor/fimedinet'),
            ], 'escudero.views');*/

            // Publishing the translation files.
            /*$this->publishes([
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/fimedinet'),
            ], 'escudero.views');*/

            // Registering package commands.
            // $this->commands([]);
        }
    }

    /**
     * Register any package services.
     *
     * @return void
     */
    public function register()
    {
        $this->mergeConfigFrom(__DIR__.'/../config/escudero.php', 'escudero');

        // Register the service the package provides.
        $this->app->singleton('escudero', function ($app) {
            return new Escudero;
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['escudero'];
    }
}