File: D:/HostingSpaces/Neopoints/momsecurity.be/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\Componentables\ComponentableService;
use App\Komma\Dynamic\Componentables\ComponentableServiceInterface;
use App\Komma\Dynamic\ComponentArea\ComponentAreaService;
use App\Komma\Dynamic\ComponentArea\ComponentAreaServiceInterface;
use App\Komma\Dynamic\ComponentType\AbstractComponentTypeBuilder;
use App\Komma\Dynamic\ComponentType\ComponentTypeBuilder;
use App\Komma\ImageProcessing\CropperInterface;
use App\Komma\ImageProcessing\ImageService;
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 App\Komma\Users\Models\User;
use App\Policies\UserPolicy;
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->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(AbstractComponentTypeBuilder::class, ComponentTypeBuilder::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');
}
}