mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 10:21:37 +00:00
30 lines
556 B
PHP
Executable File
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',
|
|
];
|
|
}
|
|
}
|