middleware('auth'); } public function index() { $user = Auth::user(); $data = [ 'user' => $user, 'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(), 'upgrade' => Product::where('active', true)->where('show_at', '=', 4)->where('identifier', 'upgrade')->get(), ]; return view('user.membership.index', $data); } public function storePayment($step = 0){ if(Input::get('switchers-package-wizard')){ $user = Auth::user(); Yard::instance('shopping')->destroy(); $product = Product::find(Input::get('switchers-package-wizard')); if(Input::get('abo_options')){ $user->abo_options = true; $user->save(); } if($product && $product->active && $product->show_at >= 3){ $image = ""; if($product->images->count()){ $image = $product->images->first()->slug; } $qty = Input::get('qty') ? Input::get('qty') : 1; Yard::instance('shopping')->add($product->id, $product->getLang('name'), $qty, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]); do { $identifier = Util::getToken(); } while( ShoppingInstance::where('identifier', $identifier)->count() ); ShoppingInstance::create([ 'identifier' => $identifier, 'user_shop_id' => 1, //is first faker shop! 'auth_user_id' => Auth::user()->id, 'subdomain' => url('/'), 'country_id' => Yard::instance('shopping')->getShippingCountryId(), ]); Yard::instance('shopping')->store($identifier); //add to DB $path = route('checkout.checkout_card', ['identifier'=>$identifier]); //$path = str_replace('http', 'https', $path); return redirect()->secure($path); } } \Session()->flash('alert-error', "Fehler beim Produkt"); return back(); } }