mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
31 lines
604 B
PHP
Executable File
31 lines
604 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Actions\Site;
|
|
|
|
use App\Models\DeploymentScript;
|
|
use App\Models\Site;
|
|
|
|
class UpdateDeploymentScript
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $input
|
|
*/
|
|
public function update(Site $site, array $input): void
|
|
{
|
|
/** @var DeploymentScript $script */
|
|
$script = $site->deploymentScript;
|
|
$script->content = $input['script'];
|
|
$script->save();
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<string>>
|
|
*/
|
|
public static function rules(): array
|
|
{
|
|
return [
|
|
'script' => ['required', 'string'],
|
|
];
|
|
}
|
|
}
|