/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // $order = Order::find($id); $order = Order::findOrFail($id); $orders = Order::where('cliente', '=', $id)->get(); $user = $order->user(); $orders = $user->orders(); }
/** * Update the specified order in storage. * * @param int $id * @return Response */ public function update($id) { $order = Order::findOrFail($id); $validator = Validator::make($data = Input::all(), Order::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $order->update($data); return Redirect::route('orders.index'); }
public function invoice($id) { $order = Order::findOrFail($id); $pdf = PDF::loadView('pdf.invoice', compact('order'))->setPaper('a4')->setOrientation('portrait'); return $pdf->stream('invoice.pdf'); }
public function procOrder($id) { $order = Order::findOrFail($id); $order->status = 2; $order->save(); $items = Order::findOrFail($id)->orderItems; $user = Order::findOrFail($id)->user; $customer = Customer::where('nama', '=', $user->nama)->first(); return View::make('admin.orders.process', compact('order', 'items', 'customer')); }
/** * Update the specified product in storage. * * @param int $id * @return Response */ public function update($id) { $order = Order::findOrFail($id); $order->update(Input::all()); return Response::json(array('success' => true)); }