diff --git a/app/Http/Controllers/RegenerateLicenseKeyController.php b/app/Http/Controllers/RegenerateLicenseKeyController.php new file mode 100644 index 00000000..ace47228 --- /dev/null +++ b/app/Http/Controllers/RegenerateLicenseKeyController.php @@ -0,0 +1,24 @@ +isAssignedTo(current_user())) { + abort(403, "License {$license->id} is not assigned to user id" . current_user()->id); + } + + $license->update([ + 'key' => Str::random(64), + ]); + + flash()->success('License key regenerated.'); + + return redirect()->back(); + } +} diff --git a/resources/views/front/profile/purchases.blade.php b/resources/views/front/profile/purchases.blade.php index c4baa47d..e477b0b0 100644 --- a/resources/views/front/profile/purchases.blade.php +++ b/resources/views/front/profile/purchases.blade.php @@ -135,6 +135,16 @@ class="fa-secondary" class="fa-primary" fill="currentColor" d="M96 392V96H24a24 24 0 0 0-24 24v368a24 24 0 0 0 24 24h272a24 24 0 0 0 24-24v-40H152a56.06 56.06 0 0 1-56-56zM441 73L375 7a24 24 0 0 0-17-7h-6v96h96v-6.06A24 24 0 0 0 441 73z"> +
@@ -212,11 +222,6 @@ class="px-6 flex justify-between items-center text-xs py-4 border-b border-gray- - @once - @push('scripts') - - @endpush - @endonce @push('scripts')