public function changeStatus(Request $request, Order $order, Product $product, $id) { $input = $request->order_status; if ($input == 4) { $content = $order->find($id)->content; foreach ($content as $item) { $product->restIncrement($item->product_id, $item->quantity); } } $order->changeStatus($id, $input); $status = $order->find($id)->status->title; return redirect()->back()->with('message', "Статус заказа изменен на '{$status}'"); }
public function orderChangeStatus($id) { $statusId = Request::input('status'); Order::changeStatus($id, $statusId); return Redirect::to('/admin/zamowienie/' . $id)->with('message', 'Status został zmieniony.'); }