diff --git a/app/Http/Controllers/Api/Admin/Service/ServiceController.php b/app/Http/Controllers/Api/Admin/Service/ServiceController.php
new file mode 100644
index 0000000..ed3c555
--- /dev/null
+++ b/app/Http/Controllers/Api/Admin/Service/ServiceController.php
@@ -0,0 +1,50 @@
+per_page ?? 15), 100);
+
+ $query = Service::with(['customer:id,uuid,fullname,email', 'product:id,uuid,name', 'invoice:id,invoice_number', 'vmware:id,name,module_ip_address'])
+ ->when($request->filter, fn($q, $v) => $q->where('server_name', 'like', "%{$v}%"))
+ ->when($request->status, fn($q, $v) => $q->where('status', $v))
+ ->when($request->customer_id, fn($q, $v) => $q->where('customer_id', $v));
+
+ $paginator = $query->latest()->paginate($perPage);
+
+ return response()->json([
+ 'error' => false,
+ 'data' => [
+ 'items' => $paginator->items(),
+ 'total' => $paginator->total(),
+ 'per_page' => $paginator->perPage(),
+ 'current_page' => $paginator->currentPage(),
+ 'last_page' => $paginator->lastPage(),
+ ],
+ ]);
+ }
+
+ public function show(int $id): JsonResponse
+ {
+ $service = Service::with(['customer', 'product', 'orderItem', 'invoice', 'vmware', 'addons'])
+ ->findOrFail($id);
+
+ return response()->json(['error' => false, 'data' => $service]);
+ }
+
+ public function detachCustomer(int $id): JsonResponse
+ {
+ $service = Service::findOrFail($id);
+ $service->update(['customer_id' => null]);
+
+ return response()->json(['error' => false, 'message' => 'Đã gỡ khách hàng khỏi dịch vụ.']);
+ }
+}
diff --git a/resources/views/emails/customer/password-reset-admin.blade.php b/resources/views/emails/customer/password-reset-admin.blade.php
index d054de7..6b69aec 100644
--- a/resources/views/emails/customer/password-reset-admin.blade.php
+++ b/resources/views/emails/customer/password-reset-admin.blade.php
@@ -1,63 +1,188 @@
-
-
-
-
-
- Cập nhật mật khẩu — {{ $appName }}
-
-
-
-
-
-
+@php
+ $appName = $appName ?? config('app.name', 'Thế Giới Số');
+ $fullName = $fullName ?? 'Quý khách';
+ $email = $email ?? '';
+ $password = $password ?? '';
+ $loginUrl = $loginUrl ?? rtrim((string) env('FRONTEND_URL', config('app.url')), '/') . '/dang-nhap';
+ $supportEmail = $supportEmail ?? 'support@tgs.com.vn';
+ $supportPhone = $supportPhone ?? '1900. 6119';
+@endphp
-
-
- Xin chào {{ $fullName }},
-
-
- Quản trị viên của {{ $appName }} vừa cấp lại mật khẩu mới cho tài khoản của bạn.
- Vui lòng sử dụng thông tin bên dưới để đăng nhập và đổi lại mật khẩu của bạn ngay sau đó.
-
-
-
-
Tài khoản: {{ $email }}
-
Mật khẩu mới: {{ $password }}
-
-
-
-
-
- Nếu bạn không yêu cầu thao tác này, vui lòng liên hệ ngay với chúng tôi qua
- {{ $supportEmail }}.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ |
+ 🔐
+
+ Mật khẩu của bạn đã được cập nhật
+
+
+ Quản trị viên vừa cấp lại mật khẩu mới cho tài khoản của bạn
+
+ |
+
+
+
+
+
+
+ |
+
+ Xin chào {{ $fullName }},
+
+
+ Quản trị viên của {{ $appName }} vừa cấp lại mật khẩu mới cho tài khoản của bạn.
+ Vui lòng sử dụng thông tin bên dưới để đăng nhập và đổi lại mật khẩu của bạn ngay sau đó.
+
+
+
+
+
+ |
+ Tài khoản: {{ $email }}
+ Mật khẩu mới: {{ $password }}
+ |
+
+
+
+
+
+
+
+ Nếu bạn không yêu cầu thao tác này, vui lòng liên hệ ngay với chúng tôi qua {{ $supportEmail }}.
+
+
+
+ Email này được gửi tự động. Vui lòng không trả lời email này.
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+ |
+
+ |
+
+
+ | |
+
+
+ |
+
+ |
+
+
+ | |
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+
diff --git a/routes/api.php b/routes/api.php
index 65ba3f2..93911d3 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -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)