diff --git a/app/Livewire/Project/Application/DeploymentNavbar.php b/app/Livewire/Project/Application/DeploymentNavbar.php
index dccd1e499..ebdc014ae 100644
--- a/app/Livewire/Project/Application/DeploymentNavbar.php
+++ b/app/Livewire/Project/Application/DeploymentNavbar.php
@@ -50,6 +50,28 @@ public function force_start()
}
}
+ public function copyLogsToClipboard(): string
+ {
+ $logs = json_decode($this->application_deployment_queue->logs, associative: true, flags: JSON_THROW_ON_ERROR);
+
+ if (! $logs) {
+ return '';
+ }
+
+ $markdown = "# Deployment Logs\n\n";
+ $markdown .= "```\n";
+
+ foreach ($logs as $log) {
+ if (isset($log['output'])) {
+ $markdown .= $log['output']."\n";
+ }
+ }
+
+ $markdown .= "```\n";
+
+ return $markdown;
+ }
+
public function cancel()
{
$deployment_uuid = $this->application_deployment_queue->deployment_uuid;
diff --git a/resources/views/livewire/project/application/deployment-navbar.blade.php b/resources/views/livewire/project/application/deployment-navbar.blade.php
index effb6b6fe..60c660bf7 100644
--- a/resources/views/livewire/project/application/deployment-navbar.blade.php
+++ b/resources/views/livewire/project/application/deployment-navbar.blade.php
@@ -5,6 +5,9 @@
@else
Show Debug Logs
@endif
+ @if (isDev())
+ Copy Logs
+ @endif
@if (data_get($application_deployment_queue, 'status') === 'queued')
Force Start
@endif