vito/app/Actions/Server/CreateServerLog.php
2025-03-12 13:31:10 +01:00

35 lines
660 B
PHP
Executable File

<?php
namespace App\Actions\Server;
use App\Models\Server;
use Illuminate\Validation\ValidationException;
class CreateServerLog
{
/**
* @param array<string, mixed> $input
*
* @throws ValidationException
*/
public function create(Server $server, array $input): void
{
$server->logs()->create([
'is_remote' => true,
'name' => $input['path'],
'type' => 'remote',
'disk' => 'ssh',
]);
}
/**
* @return array<string, string>
*/
public static function rules(): array
{
return [
'path' => 'required',
];
}
}