Delete order from CMS
-
Hello, How can I delete order from cms?
I tried thisOrder repository + controller CMS public function delete($id) { $order = $this->orderRepository->delete($id); return redirect()->back(); } public function delete($orderId) { $order = $this->findOrFail($orderId); DB::delete('delete from orders where id?=', $order->id); return $order; } And this is the route and action 'title' => trans('admin::app.datagrid.delete'), 'method' => 'DELETE', 'route' => 'admin.sales.orders.delete', 'icon' => 'icon trash-icon', 'type' => 'delete' ]); Route::get('/orders/delete/{id}', 'Webkul\Admin\Http\Controllers\Sales\OrderController@delete')->defaults('_config', [ 'view' => 'admin::sales.orders.delete', ])->name('admin.sales.orders.delete');
But I get redirect back all time without delete.. how can I do this?
-
There is no order deletion code in the backend, you need to check the backend maybe some error occurred.