HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/ReturnIndustries/return-industries.nl/app/Komma/Kms/KmsServiceProvider.php
<?php namespace App\Komma\Kms;

use App\Komma\Kms\ArtisanCommands\RunTests;
use App\Komma\Auth\AuthMailService;
use App\Komma\Auth\AuthMailServiceInterface;
use App\Komma\Documents\Kms\DocumentService;
use App\Komma\Documents\Kms\DocumentServiceInterface;
use App\Komma\Components\Attributables\AttributableService;
use App\Komma\Components\Attributables\AttributableServiceInterface;
use App\Komma\Components\Componentables\ComponentableService;
use App\Komma\Components\Componentables\ComponentableServiceInterface;
use App\Komma\Components\ComponentArea\ComponentAreaService;
use App\Komma\Components\ComponentArea\ComponentAreaServiceInterface;
use App\Komma\Kms\ImageProcessing\CropperInterface;
use App\Komma\Kms\ImageProcessing\InterventionImageCropperBridge;
use App\Komma\Kms\Composers\FlashMessagesComposer;
use App\Komma\Kms\Composers\SidebarMenuComposer;
use App\Komma\Kms\Core\Attributes\Models\SelectOption;
use App\Komma\Kms\Core\Attributes\Models\SelectOptionInterface;
use App\Komma\Kms\QualityAssurance\ExtraDuskTools;
use App\Komma\Sites\Kms\SiteService;
use App\Komma\Sites\SiteServiceInterface;
use Illuminate\Support\ServiceProvider;

class KmsServiceProvider extends ServiceProvider
{
    use ExtraDuskTools;

    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $this->bootViewComposers();
        $this->bootValidators();
        $this->registerCommands();
//        $this->setupExtraDuskTools();
    }

    /**
     * Register artisan shop commands
     */
    public function registerCommands()
    {
        $this->commands([
            //Test / benchmark commands
            RunTests::class,
        ]);
    }

    public function registerHelpers()
    {
        $file = app_path('Helpers/GlobalHelpers.php');
        if (file_exists($file)) {
            require_once($file);
        }
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->registerHelpers();

        $this->app->singleton(SiteServiceInterface::class, SiteService::class);

        $this->app->singleton('App\Komma\Products\Kms\ProductRepository', function ($app, $slug) {
            return $app->make('App\Komma\Products\Kms\ProductRepositorySingleton');
        });

        $this->app->bind(CropperInterface::class, function() {
           return new InterventionImageCropperBridge();
        });

        $this->app->bind(SelectOptionInterface::class, SelectOption::class);

        $this->app->bind(SelectOptionInterface::class, SelectOption::class);

        $this->app->bind(DocumentServiceInterface::class, DocumentService::class);

        $this->app->bind(AttributableServiceInterface::class, AttributableService::class);
        $this->app->bind(ComponentableServiceInterface::class, ComponentableService::class);
        $this->app->bind(ComponentAreaServiceInterface::class, ComponentAreaService::class);
        $this->app->bind(AuthMailServiceInterface::class, AuthMailService::class);
    }

    protected function bootViewComposers()
    {
        $this->app->view->composer('kms/partials.sidebar', SidebarMenuComposer::class);
        $this->app->view->composer('kms/partials.flashMessage', FlashMessagesComposer::class);

    }

    protected function bootValidators()
    {
        \Validator::extend('csv', 'App\Komma\Kms\Core\Validators\Validator@csv');
    }
}