Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(ui): add copy button to environment variable page

peaklabs-dev0b811b5ef6b1
diff --git a/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php b/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php
index 84d03c0fe8..5492d33f90 100644
--- a/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php
+++ b/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php
@@ -28,7 +28,10 @@
<span class="data-table-cell-dash">-</span>
<span class="data-table-cell-dash">-</span>
<span class="data-table-cell-dash">-</span>
- <div class="justify-self-end">
+ <div class="flex items-center gap-0.5 justify-self-end">
+ @unless (auth()->user()?->isMember() ?? true)
+ <x-copy-button resolve="$wire.copyValue()" label="Copy value" />
+ @endunless
<x-modal-input title="Environment variable details" :closeOutside="false">
<x-slot:content>
<button type="button" data-env-settings-trigger class="icon-button shrink-0"
diff --git a/resources/views/livewire/project/shared/environment-variable/show.blade.php b/resources/views/livewire/project/shared/environment-variable/show.blade.php
index eaa680bbc2..9172b99e18 100644
--- a/resources/views/livewire/project/shared/environment-variable/show.blade.php
+++ b/resources/views/livewire/project/shared/environment-variable/show.blade.php
@@ -83,7 +83,10 @@
@endif
@endforeach
@endif
- <div class="justify-self-end">
+ <div class="flex items-center gap-0.5 justify-self-end">
+ @if (! $isLocked && ! $isValueHidden)
+ <x-copy-button resolve="$wire.copyValue()" label="Copy value" />
+ @endif
{{-- Open modal immediately (Alpine); decrypt value in a follow-up Livewire request. --}}
<x-modal-input title="Edit environment variable" :closeOutside="false" :wireIgnore="false"
wireOpen="editorOpen">