lasthourcloud/app/Actions/Database/StopDatabaseProxy.php

23 lines
609 B
PHP
Raw Normal View History

<?php
namespace App\Actions\Database;
2023-10-24 12:31:28 +00:00
use App\Models\StandaloneMariadb;
2023-10-19 11:32:03 +00:00
use App\Models\StandaloneMongodb;
2023-10-24 12:31:28 +00:00
use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use Lorisleiva\Actions\Concerns\AsAction;
class StopDatabaseProxy
{
use AsAction;
2023-10-24 12:31:28 +00:00
public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|StandaloneMysql|StandaloneMariadb $database)
{
instant_remote_process(["docker rm -f {$database->uuid}-proxy"], $database->destination->server);
$database->is_public = false;
$database->save();
}
}