Files
portal-api/routes/customer.php
T
pbao9 057353a2e1 feat: Enhance product support in Cart and OrderItem models
- Added new fields 'billing_cycle' and 'product_pricing_id' to Cart and OrderItem models.
- Updated product retrieval logic to support both new and legacy systems.
- Introduced relationships for Product and ProductPricings in Cart and OrderItem models.
- Created migration to add new fields to the carts and order_item tables.
- Updated frontend service index to handle new pricing structure and billing cycles.
- Improved UI components for better user experience in product selection and pricing display.
- Refactored action buttons in various views for consistency and improved styling.
2026-02-09 08:04:56 +07:00

137 lines
8.0 KiB
PHP

<?php
use App\Http\Controllers\frontend\CartController;
use App\Http\Controllers\frontend\CustomerLogController;
use App\Http\Controllers\frontend\DomainController as CustomerDomainController;
use App\Http\Controllers\frontend\InvoiceController as CustomerInvoice;
use App\Http\Controllers\frontend\MainController;
use App\Http\Controllers\frontend\ManagerService;
use App\Http\Controllers\frontend\PostController as CustomerPostController;
use App\Http\Controllers\frontend\RechargeController;
use App\Http\Controllers\frontend\ServiceController;
use App\Http\Controllers\frontend\ShopController;
use App\Http\Controllers\frontend\TicketController;
use App\Http\Controllers\frontend\Order\OrderController as ClientOrderController;
use App\Http\Controllers\frontend\UserController as ClientController;
use Illuminate\Support\Facades\Route;
Route::middleware("IsLoginCheck")
->controller(ClientController::class)
->group(function () {
Route::get('dang-nhap', 'Login')->name('user.login');
Route::post('dang-nhap', 'LoginStore')->name("user.login.store");
Route::get('quen-mat-khau', 'Reset')->name('user.reset');
Route::post('quen-mat-khau', 'ResetStore')->name('user.reset.store');
Route::get('dang-ky-tai-khoan', 'Register')->name('user.register');
Route::post('dang-ky-tai-khoan', 'RegisterStore')->name('user.register.store');
Route::get('xac-thuc-tai-khoan', 'Verify')->name('user.verify');
Route::post('cap-nhat-thong-bao', 'updateNotification')->name('user.updateNotification');
});
Route::middleware("CustomerLoginCheck")->group(function () {
// Route::get('/trang-chu', [MainController::class, 'index'])->name("home_old");
Route::get('/', [MainController::class, 'index_new'])->name('home');
Route::get('nhat-ky-hoat-dong', [CustomerLogController::class, 'index'])->name('frontend.customer.log');
Route::controller(ClientController::class)->group(function () {
Route::get('dang-xuat', 'Logout')->name("user.logout");
Route::get('thong-tin-tai-khoan', 'Information')->name('user.information');
Route::put('thong-tin-tai-khoan', 'StoreInformation')->name('user.information.store');
Route::get('lich-su-email', 'Email')->name('user.email');
Route::get('chi-tiet-email', 'ViewEmail')->name('user.email.view');
Route::get('doi-mat-khau', 'ChangePassword')->name('user.password');
Route::put('doi-mat-khau', 'StoreChangePassword')->name('user.password.store');
});
Route::controller(TicketController::class)->group(function () {
Route::get('danh-sach-yeu-cau-support', 'index')->name('ticket');
Route::get('gui-yeu-cau-support', 'create')->name('ticket.create');
Route::post('gui-yeu-cau-support', 'store')->name('ticket.store');
Route::get('xem-yeu-cau-support', 'show')->name('ticket.show');
Route::post('reply-yeu-cau-support', 'ReplyStore')->name('ticket.reply.store');
Route::put('dong-yeu-cau-support', 'ClosedTicket')->name('ticket.closed');
});
Route::controller(CustomerInvoice::class)->group(function () {
Route::post('thanh-toan-hoa-don/{order_id}/{order_num}', 'store')->name('client.invoice.store');
Route::get('danh-sach-hoa-don', 'index')->name('invoice.index');
Route::get('chi-tiet-hoa-don/{invoice_id}/{order_num}', 'show')->name('invoice.show');
});
Route::controller(ShopController::class)->group(function () {
Route::get('danh-sach-dich-vu', 'index')->name('shop');
Route::get('dich-vu/{slug}', 'show')->name('shop.show');
Route::get('product/{slug}', 'getProduct')->name('shop.product');
Route::post('them-vao-gio-hang', 'store')->name('shop.store');
});
Route::controller(ClientOrderController::class)->group(function () {
Route::post('them-order', 'store')->name('client.order.store');
Route::get('don-hang/{order_id}/thanh-toan', 'payment')->name('client.order.payment');
Route::delete('don-hang/{order_id}', 'destroy')->name('client.order.destroy');
Route::get('danh-sach-don-hang', 'index')->name('order.index');
});
Route::controller(CartController::class)->group(function () {
Route::post('them-gio-hang', 'addCart')->name('cart.add');
Route::get('gio-hang', 'index')->name('cart.index');
Route::post('gio-hang', 'order')->name('cart.store');
Route::post('add-coupon', 'applyCoupon')->name('cart.applyCoupon');
Route::get('remove-item-gio-hang', 'destroy')->name('cart.remove');
Route::post('order-addon', 'addon')->name('cart.addon');
});
Route::controller(ManagerService::class)->group(function () {
Route::get('dich-vu-cua-toi', 'index')->name('service.index');
Route::get('chi-tiet-dich-vu', 'show')->name('service.show');
Route::post('reinstall-vmware', 'reinstall')->name('service.reinstall');
Route::post('task-action', 'action')->name('service.action');
Route::post('task-snapshot', 'snapshot')->name('service.snapshot');
Route::get('view-console', 'console')->name('service.console');
});
// Service Controller routes
Route::prefix('dich-vu-dang-ky')->controller(ServiceController::class)->group(function () {
Route::get('{invoice_ordernum}', 'show')->name('service.detail');
Route::post('{invoice_ordernum}/vm/toggle', 'toggleVM')->name('service.vm.toggle');
Route::get('{invoice_ordernum}/vm/info', 'getVMInfo')->name('service.vm.info');
Route::get('{invoice_ordernum}/vmware-demo', 'vmwareDemo')->name('service.vmware.demo');
Route::get('{invoice_ordernum}/vm-console', 'vmConsole')->name('service.vm.console');
Route::post('secure/create-snapshots', 'createSnapshots')->name('service.create.snapshots');
Route::get('secure/get-snapshots', 'getSnapshots')->name('service.get.snapshots');
Route::post('secure/remove-snapshot', 'removeSnapshot')->name('service.remove.snapshot');
Route::post('secure/revert-snapshot', 'revertSnapshot')->name('service.revert.snapshot');
Route::post('secure/reinstall-vm', 'reinstallVM')->name('service.reinstall.vm');
Route::post('secure/reset-vm-password', 'resetVMPassword')->name('service.reset.vm.password');
Route::post('secure/change-remote-port', 'changeRemotePort')->name('service.change.remote.port');
Route::post('secure/change-ip', 'changeIP')->name('service.change.ip');
Route::post('secure/renew-price', 'renewPrice')->name('service.renew.price');
Route::post('secure/renew', 'renew')->name('service.renew');
Route::post('secure/start-vm', 'startVM')->name('service.start.vm');
Route::post('secure/stop-vm', 'stopVM')->name('service.stop.vm');
Route::post('secure/reboot-vm', 'rebootVM')->name('service.reboot.vm');
});
Route::controller(CustomerDomainController::class)->group(function () {
Route::get('danh-sach-ten-mien', 'index')->name('customer.domain.index');
});
Route::controller(RechargeController::class)->group(function () {
Route::get('nap-tien', 'index')->name('recharge.index');
Route::post('nap-tien', 'paymentProcess')->name('recharge.paymentProcess.vnPay');
Route::get('nap-tien/return', 'paymentReturn')->name('recharge.return');
Route::get('thanh-toan', 'show')->name('recharge.show');
Route::get('lich-su-giao-dich', 'HistoryRecharge')->name('recharge.history');
Route::get('callback-function', 'CallbackResponse')->name('recharge.CallbackResponse');
});
Route::controller(CustomerPostController::class)->group(function () {
Route::get('tin-tuc/{slug}', 'view')->name('post');
});
Route::controller(\App\Http\Controllers\frontend\Whois\WhoisController::class)->group(function () {
Route::get('kiem-tra-ten-mien', 'index')->name('whois.index');
Route::post('api/whois/domain-info', 'getDomainInfo')->name('whois.domain-info');
Route::post('api/whois/check-availability', 'checkAvailability')->name('whois.check-availability');
});
});