Refactor views to use new layout structure and update routes for administrator pages
- Changed view extends from "admin.main" to "administrator.layout.master" across multiple files. - Updated route names in admin.php and administrator.php to reflect new structure for user, order, invoice, and other management functionalities. - Adjusted view includes to point to the new directory structure for blocks and components. - Ensured all permission checks remain intact while refactoring the views.
This commit is contained in:
@@ -59,7 +59,7 @@ class OrderController extends Controller
|
||||
|
||||
$title = 'List all orders';
|
||||
|
||||
return view('admin.order.index', compact('title', 'orders'));
|
||||
return view('administrator.pages.order.index', compact('title', 'orders'));
|
||||
}
|
||||
|
||||
// Tính billing
|
||||
@@ -254,7 +254,7 @@ class OrderController extends Controller
|
||||
DB::rollBack();
|
||||
return back()->withErrors($error->getMessage());
|
||||
}
|
||||
return redirect()->route('admin.order.edit', ['id' => $order]);
|
||||
return redirect()->route('administrator.pages.order.edit', ['id' => $order]);
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ class OrderController extends Controller
|
||||
$discount = Discount::select('id', 'code', 'save', 'type')->where('status', 1)->get();
|
||||
$type = Type::select('id', 'name')->where('status', 1)->get();
|
||||
|
||||
return view('admin.order.add', compact('title', 'customer', 'payment', 'discount', 'type'));
|
||||
return view('administrator.pages.order.add', compact('title', 'customer', 'payment', 'discount', 'type'));
|
||||
}
|
||||
|
||||
public function edit(int $id = 0)
|
||||
@@ -274,7 +274,7 @@ class OrderController extends Controller
|
||||
$order = $this->orderRepository->findWithRelationships($id, ['orderItem', 'user', 'customer.invoiceItem.type', 'payment', 'discount', 'invoice.invoiceItem']);
|
||||
|
||||
if (!$order) {
|
||||
return redirect()->route('admin.order.index')->withErrors('Can\'t find a order by order id #' . $id);
|
||||
return redirect()->route('administrator.pages.order.index')->withErrors('Can\'t find a order by order id #' . $id);
|
||||
}
|
||||
|
||||
$title = 'View Manage Order';
|
||||
@@ -283,7 +283,7 @@ class OrderController extends Controller
|
||||
$item->status = $this->invoiceItemRepository->findServiceStatus($item->relid, $item->type_id);
|
||||
return $item;
|
||||
});
|
||||
return view('admin.order.edit', compact('title', 'order'));
|
||||
return view('administrator.pages.order.edit', compact('title', 'order'));
|
||||
}
|
||||
|
||||
public function update(int $id, UpdateOrderRequest $request)
|
||||
@@ -291,7 +291,7 @@ class OrderController extends Controller
|
||||
$order = $this->orderRepository->findWithRelationships($id, ['invoice', 'orderItem']);
|
||||
|
||||
if (!$order) {
|
||||
return redirect()->route('admin.order.index')->withErrors('Invalid request');
|
||||
return redirect()->route('administrator.pages.order.index')->withErrors('Invalid request');
|
||||
}
|
||||
|
||||
$status = match ($request->action) {
|
||||
|
||||
Reference in New Issue
Block a user