mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-17 17:01:37 +00:00
31 lines
604 B
PHP
Executable File
31 lines
604 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Actions\Site;
|
|
|
|
use App\Models\Site;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Validation\ValidationException;
|
|
|
|
class UpdateBranch
|
|
{
|
|
/**
|
|
* @throws ValidationException
|
|
*/
|
|
public function update(Site $site, array $input): void
|
|
{
|
|
$this->validate($input);
|
|
|
|
$site->updateBranch($input['branch']);
|
|
}
|
|
|
|
/**
|
|
* @throws ValidationException
|
|
*/
|
|
protected function validate(array $input): void
|
|
{
|
|
Validator::make($input, [
|
|
'branch' => 'required',
|
|
])->validateWithBag('updateBranch');
|
|
}
|
|
}
|