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

55 lines
1.1 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\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;
use Webkul\Checkout\Facades\Cart;
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
{
/**
* Bootstrap services.
*
* @return void
*/
public function boot(): void
2018-09-06 06:20:30 +00:00
{
2021-10-06 12:26:08 +00:00
include __DIR__ . '/../Http/helpers.php';
2018-09-28 13:28:54 +00:00
2021-10-06 12:26:08 +00:00
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
2019-02-18 07:30:40 +00:00
2019-10-31 11:37:49 +00:00
$this->app->register(EventServiceProvider::class);
$this->app->register(ModuleServiceProvider::class);
2018-09-06 06:20:30 +00:00
}
/**
* Register services.
*
* @return void
*/
public function register(): void
2018-09-06 06:20:30 +00:00
{
$this->registerFacades();
}
/**
* Register cart as a singleton.
*
* @return void
*/
protected function registerFacades(): void
{
$loader = AliasLoader::getInstance();
$loader->alias('cart', Cart::class);
$this->app->singleton('cart', function () {
return new Cart();
});
2022-07-11 12:21:33 +00:00
$this->app->singleton('cart', \Webkul\Checkout\Cart::class);
2018-09-06 06:20:30 +00:00
}
}