File: D:/HostingSpaces/PDeckers/opelkapitan.nl/workbench/komma/kms/src/Komma/Kms/KmsServiceProvider.php
<?php namespace Komma\Kms;
use Illuminate\Support\ServiceProvider;
use Komma\Kms\Shops\Shop;
use Komma\Kms\Shops\ShopsRepository;
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->package('komma/kms','kms');
require_once __DIR__ . '/../../filters.php';
require_once __DIR__ . '/../../routes.php';
require_once __DIR__ . '/../../helpers.php';
$this->bootViewComposers();
$this->bootValidators();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->bind('kms.shop', function($app, $slug)
{
return $app['kms.shop.repository']->findBySlug($slug);
});
$this->app->bind('kms.shop.repository', function($app)
{
return (new ShopsRepository(new Shop));
});
}
protected function bootViewComposers()
{
$this->app->view->composer('kms::partials.sidebar', 'Komma\Kms\Composers\KmsSidebarMenuComposer');
$this->app->view->composer('kms::partials.flashmessages', 'Komma\Kms\Composers\KmsFlashMessagesComposer');
//$this->app->view->composer('kms::attributeCustomViews.orderOverview', 'Komma\Kms\Orders\AttributeComposers\OrderOverviewComposer');
}
protected function bootValidators()
{
\Validator::extend('csv', 'Komma\Kms\Core\Validators\Validator@csv');
\Validator::extend('required_if_not_empty', 'Komma\Kms\Core\Validators\Validator@requiredIfNotEmpty');
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
}