mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 13:22:05 +07:00
feat: implement CDN Purge Artisan command and UI dashboard control
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user