feat: implement CDN Purge Artisan command and UI dashboard control

This commit is contained in:
dyzulk
2026-01-07 11:06:33 +07:00
parent 2393be46f6
commit 0e67f8d273
4 changed files with 73 additions and 0 deletions

View File

@@ -171,6 +171,23 @@ class RootCaApiController extends Controller
}
}
public function purgeCdn()
{
$this->authorizeAdminOrOwner();
try {
$this->sslService->purgeAllCaFromCdn();
return response()->json([
'status' => 'success',
'message' => 'CDN assets purged successfully and local sync status reset.'
]);
} catch (\Exception $e) {
return response()->json([
'status' => 'error',
'message' => 'Purge failed: ' . $e->getMessage()
], 500);
}
}
protected function authorizeAdminOrOwner()
{
if (!auth()->user()->isAdminOrOwner()) {