Пример #1
0
 /**
  * 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);
 }
Пример #2
0
 public static function commodity()
 {
     $result = [];
     foreach (Commodity::all() as $commodity) {
         $result[] = ['id' => $commodity->id, 'name' => $commodity->name, 'count' => self::getCommoditySoldSum($commodity)];
     }
     return $result;
 }
Пример #3
0
 public function category()
 {
     return view('shop.category')->with(['items' => Commodity::all()]);
 }
Пример #4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $commodities = Commodity::all();
     return view('commodity.index')->with('commodities', $commodities);
 }