mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-22 19:22:19 +00:00
25 lines
493 B
PHP
25 lines
493 B
PHP
<?php
|
|
|
|
namespace App\Actions\Site;
|
|
|
|
use App\Models\Site;
|
|
use App\SSHCommands\System\EditFileCommand;
|
|
|
|
class UpdateEnv
|
|
{
|
|
public function update(Site $site, array $input): void
|
|
{
|
|
$typeData = $site->type_data;
|
|
$typeData['env'] = $input['env'];
|
|
$site->type_data = $typeData;
|
|
$site->save();
|
|
|
|
$site->server->ssh()->exec(
|
|
new EditFileCommand(
|
|
$site->path.'/.env',
|
|
$site->env
|
|
)
|
|
);
|
|
}
|
|
}
|