File: D:/HostingSpaces/SBogers10/centrum8a.komma.pro/app/KommaApp/Kms/KmsServiceProvider.php
<?php namespace App\KommaApp\Kms;
use App\KommaApp\Documents\Kms\DocumentService;
use App\KommaApp\Documents\Kms\DocumentServiceInterface;
use App\KommaApp\Images\CropperInterface;
use App\KommaApp\Images\ImageService;
use App\KommaApp\Images\InterventionImageCropperBridge;
use App\KommaApp\Kms\Composers\KmsFlashMessagesComposer;
use App\KommaApp\Kms\Composers\KmsSidebarMenuComposer;
use App\KommaApp\Kms\Core\Attributes\Models\SelectOption;
use App\KommaApp\Kms\Core\Attributes\Models\SelectOptionInterface;
use App\KommaApp\Kms\Core\Kms;
use App\KommaApp\Kms\Core\KmsInterface;
use App\KommaApp\Kms\Core\Tree\Tree;
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();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton(KmsInterface::class, Kms::class);
$this->app->singleton('App\KommaApp\Products\Kms\ProductRepository', function ($app, $slug) {
return $app->make('App\KommaApp\Products\Kms\ProductRepositorySingleton');
});
$this->app->bind(CropperInterface::class, function() {
return new InterventionImageCropperBridge();
});
$this->app->bind('Tree', function() {
return new Tree();
});
$this->app->bind('ImageService', ImageService::class);
$this->app->bind(SelectOptionInterface::class, SelectOption::class);
$this->app->bind(DocumentServiceInterface::class, DocumentService::class);
}
protected function bootViewComposers()
{
$this->app->view->composer('kms/partials.sidebar', KmsSidebarMenuComposer::class);
$this->app->view->composer('kms/partials.flashMessage', KmsFlashMessagesComposer::class);
}
protected function bootValidators()
{
\Validator::extend('csv', 'App\KommaApp\Kms\Core\Validators\Validator@csv');
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
}