/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $receipt = Receipt::find($id); $suppliers = Supplier::all()->lists('name', 'id'); $commodities = Commodity::all()->lists('name', 'id'); return view('receipt.edit')->with('receipt', $receipt)->with('commodities', $commodities)->with('suppliers', $suppliers); }
public static function commodity() { $result = []; foreach (Commodity::all() as $commodity) { $result[] = ['id' => $commodity->id, 'name' => $commodity->name, 'count' => self::getCommoditySoldSum($commodity)]; } return $result; }
public function category() { return view('shop.category')->with(['items' => Commodity::all()]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $commodities = Commodity::all(); return view('commodity.index')->with('commodities', $commodities); }