Ejemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //get the low level ingredients list
     // $threshold = Ingredient::where('stocks', '<','alert_level')->get();
     $threshold = Ingredient::getThresholdIngredients();
     // return $threshold;
     //show the view
     return View::make('inventory.index')->with('title', 'Store Inventory')->with('ingredients', Ingredient::all())->with('threshold', $threshold);
 }
Ejemplo n.º 2
0
 public function show($id)
 {
     if ($id == 0) {
         $ingredients = Ingredient::all();
         foreach ($ingredients as $key => $item) {
             $ingredients[$key]['type'] = \App\Type::find($item->type_id);
         }
         return response()->json(['ingredients' => $ingredients]);
     } else {
         $aux = \App\Type::all();
         $types = $this->getTypes($aux);
         $ingredient = Ingredient::find($id);
         return response()->json(['ingredient' => $ingredient, 'types' => $types]);
     }
 }
Ejemplo n.º 3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $ingredients = Ingredient::all();
     return View::make('ingredient/list')->with('ingredients', $ingredients);
 }