Esempio n. 1
0
 public function getBasked(Products $products, Slider $slider, Delivery $delivery)
 {
     if (Session::get('product')) {
         $this->data['delivery'] = $delivery->getDeliveryActive();
         $productsBasked = Session::get('product');
         $this->data['countProducts'] = collect($productsBasked);
         $productsId = '';
         $k = 0;
         foreach ($productsBasked as $id) {
             if ($k == 0) {
                 $productsId = $id['id'];
                 $k++;
             } else {
                 $productsId = $productsId . ' ,' . $id['id'];
             }
         }
         $this->data['bascedProducts'] = collect($products->getBascedProducts($productsId));
     } else {
         $this->data['bascedErrr'] = 'Корзина пуста';
     }
     $this->data['slides'] = $slider->getActive();
     $this->data['products'] = $products->getActive();
     if (\Auth::user()) {
         $this->data['name'] = \Auth::user()->name;
         $this->data['address'] = \Auth::user()->address;
         $this->data['email'] = \Auth::user()->email;
         $this->data['number'] = \Auth::user()->number;
     }
     return view('pages.cart', $this->data);
 }
Esempio n. 2
0
 public function goUrl($slug, Slider $slider, Pages $pages)
 {
     $this->data['slides'] = $slider->getActive();
     $this->data['content'] = $pages->getActive($slug);
     //dd( $this->data['content']);
     return view('pages.page', $this->data);
 }
 public function search(Slider $slider, Products $products)
 {
     $search = Input::all();
     $search = $this->parsing($search['search']);
     $this->data['products'] = $products->searchProduct($search);
     $this->data['slides'] = $slider->getActive();
     return view('pages.index', $this->data);
 }
Esempio n. 4
0
 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]);
 }
Esempio n. 5
0
 public function index(Slider $slider)
 {
     $this->data['slides'] = $slider->getActive();
     return view('pages.index', $this->data);
 }
Esempio n. 6
0
 public function getCategoryProduct($id, Slider $slider, Products $products)
 {
     $this->data['slides'] = $slider->getActive();
     $this->data['products'] = $products->getCategoryProduct($id);
     return view('pages.index', $this->data);
 }