<?php namespace Orchestra\View;

use Illuminate\Support\ServiceProvider;
use Orchestra\View\Console\DetectCommand;
use Orchestra\View\Console\ActivateCommand;
use Orchestra\View\Console\OptimizeCommand;

class CommandServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('orchestra.view.command.activate', function ($app) {
            $finder = $app['orchestra.theme.finder'];

            return new ActivateCommand($finder);
        });

        $this->app->singleton('orchestra.view.command.detect', function ($app) {
            $finder = $app['orchestra.theme.finder'];

            return new DetectCommand($finder);
        });

        $this->app->singleton('orchestra.view.command.optimize', function () {
            return new OptimizeCommand();
        });

        $this->commands([
            'orchestra.view.command.activate',
            'orchestra.view.command.detect',
            'orchestra.view.command.optimize',
        ]);
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return [
            'orchestra.view.command.activate',
            'orchestra.view.command.detect',
            'orchestra.view.command.optimize',
        ];
    }
}

<?php namespace Orchestra\View;

use Orchestra\View\Console\DetectCommand;
use Orchestra\View\Console\ActivateCommand;
use Orchestra\View\Console\OptimizeCommand;
use Orchestra\Support\Providers\CommandServiceProvider as ServiceProvider;

class CommandServiceProvider extends ServiceProvider
{
    /**
     * The commands to be registered.
     *
     * @var array
     */
    protected $commands = [
        'Activate' => 'orchestra.view.command.activate',
        'Detect'   => 'orchestra.view.command.detect',
        'Optimize' => 'orchestra.view.command.optimize'
    ];

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function registerActivateCommand()
    {
        $this->app->singleton('orchestra.view.command.activate', function ($app) {
            $finder = $app['orchestra.theme.finder'];

            return new ActivateCommand($finder);
        });
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function registerDetectCommand()
    {
        $this->app->singleton('orchestra.view.command.detect', function ($app) {
            $finder = $app['orchestra.theme.finder'];

            return new DetectCommand($finder);
        });
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function registerOptimizeCommand()
    {
        $this->app->singleton('orchestra.view.command.optimize', function () {
            return new OptimizeCommand();
        });
    }
}

Use available base command service provider.
Use available base command service provider.

Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
