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.

fix: convert startProxy to action

Andras Bacsai93b202bde459
diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.php
index fd14f49d5c..7af5aa0197 100644
--- a/app/Actions/Proxy/StartProxy.php
+++ b/app/Actions/Proxy/StartProxy.php
@@ -6,11 +6,13 @@ use App\Enums\ProxyStatus;
use App\Enums\ProxyTypes;
use App\Models\Server;
use Illuminate\Support\Str;
+use Lorisleiva\Actions\Concerns\AsAction;
use Spatie\Activitylog\Models\Activity;
class StartProxy
{
- public function __invoke(Server $server, bool $async = true): Activity|string
+ use AsAction;
+ public function handle(Server $server, bool $async = true): Activity|string
{
$proxyType = data_get($server,'proxy.type');
if ($proxyType === 'none') {
diff --git a/app/Http/Livewire/Server/Proxy/Deploy.php b/app/Http/Livewire/Server/Proxy/Deploy.php
index ad60ca53aa..506fd3b81a 100644
--- a/app/Http/Livewire/Server/Proxy/Deploy.php
+++ b/app/Http/Livewire/Server/Proxy/Deploy.php
@@ -27,7 +27,7 @@ class Deploy extends Component
SaveConfiguration::run($this->server);
}
- $activity = resolve(StartProxy::class)($this->server);
+ $activity = StartProxy::run($this->server);
$this->emit('newMonitorActivity', $activity->id);
} catch (\Throwable $e) {
return handleError($e);
diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php
index 20d6640bda..b7c76363cc 100644
--- a/app/Jobs/ContainerStatusJob.php
+++ b/app/Jobs/ContainerStatusJob.php
@@ -82,7 +82,7 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
})->first();
if (!$foundProxyContainer) {
if ($this->server->isProxyShouldRun()) {
- resolve(StartProxy::class)($this->server, false);
+ StartProxy::run($this->server, false);
$this->server->team->notify(new ContainerRestarted('coolify-proxy', $this->server));
}
} else {