app/Providers/CartServiceProvider.php
/**
     * Bootstrap any application services.
     *
     * @return void
     */
Bootstrap any application services.
@return void
Bootstrap any application services . @return void
public function boot()
    {
        $cart = (Auth::check())?'App\Cart\DBCart':'App\Cart\StorageCart';
        $this->app->bind(
            'App\Cart\Cart',
            $cart
        );
    }
public function boot ( ) { $ cart = ( Auth :: check ( ) ) ? 'App\Cart\DBCart' : 'App\Cart\StorageCart' ; $ this -> app -> bind ( 'App\Cart\Cart' , $ cart ) ; }
Bootstrap any application services.
Bootstrap any application services .