public function index(Slider $slider, Blog $blog, Product $shop, Section $section) { $slides = $slider->getActive(); $posts = $blog->getActive(); $products = $shop->getPopular(); // dd($products); $sections = $section->getSection(); // var_dump(\Session::get('product8')); return view('pages.index', ['slides' => $slides, 'posts' => $posts, 'products' => $products, 'sections' => $sections]); }
public function getProduct($slug, Product $product, Section $section) { $oneProduct = $product->getProduct($slug); // dd($oneProduct); $payment = $oneProduct->payment_system; $images = $oneProduct->galleries; // dd($images); $sections = $section->getSection(); if ($payment === 0) { return view('pages.shop.productWithPayment', ['product' => $oneProduct, 'images' => $images, 'sections' => $sections]); } return view('pages.shop.product', ['product' => $oneProduct, 'images' => $images, 'sections' => $sections]); }