mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
source-controls (#193)
* edit source control * assign project after creation * global and project scoped source controls
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace App\Actions\SourceControl;
|
||||
|
||||
use App\Models\SourceControl;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
@ -10,7 +11,7 @@
|
||||
|
||||
class ConnectSourceControl
|
||||
{
|
||||
public function connect(array $input): void
|
||||
public function connect(User $user, array $input): void
|
||||
{
|
||||
$this->validate($input);
|
||||
|
||||
@ -18,6 +19,7 @@ public function connect(array $input): void
|
||||
'provider' => $input['provider'],
|
||||
'profile' => $input['name'],
|
||||
'url' => Arr::has($input, 'url') ? $input['url'] : null,
|
||||
'project_id' => isset($input['global']) && $input['global'] ? null : $user->current_project_id,
|
||||
]);
|
||||
|
||||
$this->validateProvider($sourceControl, $input);
|
||||
|
Reference in New Issue
Block a user