30 lines
660 B
PHP
30 lines
660 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Cart\Providers;
|
||
|
|
||
|
use Modules\Cart\Cart;
|
||
|
use Illuminate\Support\ServiceProvider;
|
||
|
|
||
|
class CartServiceProvider extends ServiceProvider
|
||
|
{
|
||
|
/**
|
||
|
* Register the service provider.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function register()
|
||
|
{
|
||
|
$this->app->singleton(Cart::class, function ($app) {
|
||
|
return new Cart(
|
||
|
$app['session'],
|
||
|
$app['events'],
|
||
|
'cart',
|
||
|
session()->getId(),
|
||
|
config('fleetcart.modules.cart.config')
|
||
|
);
|
||
|
});
|
||
|
|
||
|
$this->app->alias(Cart::class, 'cart');
|
||
|
}
|
||
|
}
|