/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $currentPeriodId = Helper::defaultPeriodId(); $item = Purchases::findOrFail($id); $periods = StockPeriods::all(); $categories = PurchaseCategory::lists('title', 'id'); $period_list = array(); foreach ($periods as $period) { $period_list[$period->id] = 'Stock #' . $period->number . ' (' . $period->date_from . ' - ' . ($period->id == $currentPeriodId ? 'NOW' : $period->date_to) . ')'; } return view('Purchases.edit')->with(array('title' => $this->title, 'item' => $item, 'stocks_list' => $period_list, 'suppliers' => Suppliers::orderBy('title', 'ASC')->lists('title', 'id'), 'categories' => $categories)); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return view('Suppliers.index')->with(array('title' => $this->title, 'items' => Suppliers::orderBy('title', 'ASC')->get())); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $data['suppliers'] = Suppliers::orderBy('name', 'asc')->paginate(10); return view('suppliers.index', $data); }