Add ServiceController for managing customer services; implement index, show, and detachCustomer methods

This commit is contained in:
baodev0
2026-07-14 10:14:50 +07:00
parent a282d38170
commit 9cae94b807
3 changed files with 245 additions and 62 deletions
+8
View File
@@ -19,6 +19,7 @@ use App\Http\Controllers\Api\Admin\Addon\AddonController;
use App\Http\Controllers\Api\Admin\WebDesign\WebDesignQuoteController;
use App\Http\Controllers\Api\Admin\Product\ProductCategoryController;
use App\Http\Controllers\Api\Admin\Product\ProductController;
use App\Http\Controllers\Api\Admin\Service\ServiceController;
use App\Http\Controllers\Api\Admin\VPS\VPSController;
use App\Http\Controllers\Api\Admin\VCenter\VCenterController;
use App\Http\Controllers\Api\Admin\DnsManager\ServerController as DnsServerController;
@@ -148,6 +149,13 @@ Route::prefix('v1')
Route::delete('{uuid}/force', 'forceDelete')->middleware('perm:customer.destroy');
});
// Services (module: customer)
Route::prefix('services')->controller(ServiceController::class)->group(function () {
Route::get('/', 'index')->middleware('perm:customer.view');
Route::get('{id}', 'show')->middleware('perm:customer.view');
Route::patch('{id}/detach-customer', 'detachCustomer')->middleware('perm:customer.edit');
});
// Products (module: product-service)
Route::prefix('products')
->controller(ProductController::class)