mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-22 19:22:19 +00:00
32 lines
610 B
PHP
32 lines
610 B
PHP
<?php
|
|
|
|
namespace App\Actions\Site;
|
|
|
|
use App\Models\Command;
|
|
|
|
class EditCommand
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $input
|
|
*/
|
|
public function edit(Command $command, array $input): Command
|
|
{
|
|
$command->name = $input['name'];
|
|
$command->command = $input['command'];
|
|
$command->save();
|
|
|
|
return $command;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<string>>
|
|
*/
|
|
public static function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['required', 'string', 'max:255'],
|
|
'command' => ['required', 'string'],
|
|
];
|
|
}
|
|
}
|