mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
- 2.x - sites settings
- tags - source-control soft deletes
This commit is contained in:
26
app/Actions/Site/UpdatePHPVersion.php
Normal file
26
app/Actions/Site/UpdatePHPVersion.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Site;
|
||||
|
||||
use App\Models\Site;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdatePHPVersion
|
||||
{
|
||||
public static function rules(Site $site): array
|
||||
{
|
||||
return [
|
||||
'version' => [
|
||||
'required',
|
||||
Rule::exists('services', 'version')
|
||||
->where('server_id', $site->server_id)
|
||||
->where('type', 'php'),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function update(Site $site, array $input): void
|
||||
{
|
||||
$site->changePHPVersion($input['version']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user