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/SBogers95/rentman.io/app/Komma/Kms/KmsServiceProvider.php
<?php

namespace App\Komma\Kms;

use App\Komma\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\Dynamic\Attributables\AttributableService;
use App\Komma\Dynamic\Attributables\AttributableServiceInterface;
use App\Komma\Dynamic\ComponentArea\ComponentAreaService;
use App\Komma\Dynamic\ComponentArea\ComponentAreaServiceInterface;
use App\Komma\ImageProcessing\CropperInterface;
use App\Komma\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\Sites\Kms\SiteService;
use App\Komma\Sites\SiteServiceInterface;
use Illuminate\Support\ServiceProvider;

class KmsServiceProvider extends ServiceProvider
{
    /**
     * 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();
    }

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

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(SiteServiceInterface::class, SiteService::class);

        $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(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');
    }
}