public function show($id)
 {
     $design_collection = Designs::all();
     $art_collection = Products::all();
     $displayed_design = Designs::findorfail($id);
     return view('backend.admin.design.edit', compact('design_collection', 'art_collection', 'displayed_design', 'displayed_art'));
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $products = Products::all();
     //dd($products);
     return view('front.products.index', compact('products'));
     //return '产品首页';
 }
 public function __construct()
 {
     $this->middleware('auth');
     $this->brands = Brand::all();
     View::share('brands', $this->brands);
     $this->products = Products::all();
     View::share('products', $this->products);
 }
Ejemplo n.º 4
0
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     if (Cache::has('products:all')) {
         $products = Cache::get('products:all');
     } else {
         $products = Products::all();
         Cache::put('products:all', $products, 15);
     }
     return view('index', compact("products"));
 }
 public function getDashboard()
 {
     if (Auth::user()->email == '*****@*****.**') {
         $countUsers = count(User::all());
         $countProducts = count(Products::all());
         $countOrders = count(Orders::all());
         return view('admin.dashboard')->with('countUsers', $countUsers)->with('countProducts', $countProducts)->with('countOrders', $countOrders);
     }
     return redirect('/');
 }
 public function productCollection()
 {
     $products = Products::all();
     $collection = [];
     foreach ($products as $product) {
         // $neproducts = Products::where('product_name', 'LIKE', '%'.$explode[2].'%')
         //                         // ->where('id', '<>', $product->id)
         //                         ->get();
         // foreach ($neproducts as $prow) {
         //     $collection[] =  $prow->product_name;
         // }
         // dd($neproducts->product_name);
         // if($neproducts){
         //     $newarray[] = array();
         //         foreach ($neproducts as $neproduct) {
         //             $newarray = $neproduct->product_name;
         //         }
         //     $collection[] = $newarray;
         // }
     }
     // dd($collection);
 }
Ejemplo n.º 7
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $product = Products::all();
     return view('products.index', compact('product'));
 }
 public function getStudentList()
 {
     $products = Products::all();
     return $products;
 }
Ejemplo n.º 9
0
 public function create()
 {
     $disign_collection = Designs::all();
     $art_collection = Products::all();
     return view('backend.admin.artwork.create', compact('art_collection'));
 }
Ejemplo n.º 10
0
 public function __construct()
 {
     $this->categories = Category::all(array('name'));
     $this->products = Products::all(array('name', 'imgurl', 'image', 'description', 'price', 'category_id', 'brand_id', 'hot'));
     //       $this->userinfo = User::all(array('id','name','username','email'));
 }
 public function store()
 {
     $input = Input::all();
     $rules = array('email' => 'required|email', 'password' => 'required|min:5');
     $validator = \Validator::make($input, $rules);
     if ($validator->fails()) {
         return \Redirect::to('auth/login')->withInput(Input::except('password'))->withErrors($validator);
     } else {
         $attempt = \Auth::attempt(['user_email' => $input['email'], 'password' => $input['password']]);
         if ($attempt) {
             $products = Products::all();
             return \Redirect::intended('/home')->with('products', $products);
         } else {
             return \Redirect::to('auth/login')->withInput(Input::except('password'))->with('alert-danger', 'Your email or password not valid.')->withErrors($validator);
         }
     }
 }
 public function userHasLoggedIn($user)
 {
     $products = Products::all();
     $user = User::all();
     return redirect('/')->with('title', 'Home')->with('products', $products)->with('users', $user);
 }
Ejemplo n.º 13
0
 public function index()
 {
     $art_collection = Products::all();
     $design_collection = Designs::all();
     return view('backend.admin.dashboard', compact('art_collection', 'design_collection'));
 }
Ejemplo n.º 14
-1
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if ($this->user_type == 1) {
         // Supplier
         $products = $this->productRepository->findBy('user_id', $this->userid);
         return view('products.supplier', ['products' => $products]);
     } else {
         if ($this->user_type == 2) {
             // Reseller
             $products = Product::all();
             return view('products.reseller-add', ['products' => $products]);
         }
     }
 }