Exemplo n.º 1
0
 /**
  * Bind data to the view.
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $products = Product::allLists();
     $shopkeepers = User::searchShopkeepers();
     $communes = ['1' => 'Comuna 1', '2' => 'Comuna 2', '3' => 'Comuna 3', '4' => 'Comuna 4', '5' => 'Comuna 5', '6' => 'Comuna 6', '7' => 'Comuna 7', '8' => 'Comuna 8'];
     $view->with(['communes' => $communes, 'products' => $products, 'shopkeepers' => $shopkeepers]);
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the Products.
  *
  * @return \Illuminate\Http\Response
  */
 public function getShopkeepers(Request $request)
 {
     $productId = $request->get('product_id');
     $communes = $request->get('communes');
     $shopkeepers = User::searchShopkeepers($productId, $communes);
     return response()->json(['success' => true, 'shopkeepers' => $shopkeepers]);
 }