sarga/packages/Webkul/Checkout/src/Providers/CheckoutServiceProvider.php

54 lines
1.2 KiB
PHP
Raw Normal View History

2018-09-06 06:20:30 +00:00
<?php
namespace Webkul\Checkout\Providers;
2018-09-06 06:20:30 +00:00
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
2018-09-06 06:20:30 +00:00
use Illuminate\Routing\Router;
use Illuminate\Foundation\AliasLoader;
use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer;
use Webkul\Checkout\Facades\Cart;
use Webkul\Checkout\Providers\ComposerServiceProvider;
2018-09-06 06:20:30 +00:00
2018-09-28 13:28:54 +00:00
class CheckoutServiceProvider extends ServiceProvider
2018-09-06 06:20:30 +00:00
{
2018-09-06 06:20:30 +00:00
public function boot(Router $router)
{
2018-09-27 10:01:25 +00:00
include __DIR__ . '/../Http/helpers.php';
2018-09-28 13:28:54 +00:00
2018-09-10 09:31:34 +00:00
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
2019-02-18 07:30:40 +00:00
$this->app->register(ModuleServiceProvider::class);
2018-09-06 06:20:30 +00:00
}
/**
* Register services.
*
* @return void
*/
public function register()
{
$this->registerFacades();
}
/**
* Register Bouncer as a singleton.
*
* @return void
*/
protected function registerFacades()
{
2018-09-19 07:00:24 +00:00
//to make the cart facade and bind the
//alias to the class needed to be called.
$loader = AliasLoader::getInstance();
$loader->alias('cart', Cart::class);
$this->app->singleton('cart', function () {
return new cart();
});
$this->app->bind('cart', 'Webkul\Checkout\Cart');
2018-09-06 06:20:30 +00:00
}
}