vito/app/Actions/Server/CreateServerLog.php
2024-10-09 23:32:52 +02:00

30 lines
556 B
PHP
Executable File

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