public function cancel($order_id) { $Equal_order = Equal::findOrFail($order_id); $Equal_order->state = 'الغاء بناء على طلب الطالب'; $Equal_order->save(); //save in history $order_history = new Orderhistory(); $order_history->ref_key = 'order_equals'; $order_history->ref_value = $order_id; $order_history->state = 'الغاء بناء على طلب الطالب'; $order_history->note = ''; $order_history->save(); return redirect()->route('orders.index')->with('success', trans('orders::order.cancel_success')); }