mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
35 lines
670 B
PHP
Executable File
35 lines
670 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Actions\ServerLog;
|
|
|
|
use App\Models\ServerLog;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Validation\ValidationException;
|
|
|
|
class UpdateLog
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $input
|
|
*
|
|
* @throws ValidationException
|
|
*/
|
|
public function update(ServerLog $serverLog, array $input): void
|
|
{
|
|
Validator::make($input, self::rules())->validate();
|
|
|
|
$serverLog->update([
|
|
'name' => $input['path'],
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public static function rules(): array
|
|
{
|
|
return [
|
|
'path' => 'required',
|
|
];
|
|
}
|
|
}
|