DEleted function in request and changed the way the controller uses it,
This commit is contained in:
@@ -17,6 +17,13 @@ class StoreUserGitConnectionRequest extends FormRequest
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'base_url' => $this->normalizedBaseUrl(),
|
||||
'provider' => Str::lower(trim((string) $this->input('provider'))),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
@@ -42,30 +49,6 @@ class StoreUserGitConnectionRequest extends FormRequest
|
||||
))],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'base_url' => $this->normalizedBaseUrl(),
|
||||
'provider' => Str::lower(trim((string) $this->input('provider'))),
|
||||
]);
|
||||
}
|
||||
|
||||
public function apiToken(): string
|
||||
{
|
||||
return (string) $this->validated('api_token');
|
||||
}
|
||||
|
||||
public function baseUrl(): string
|
||||
{
|
||||
return (string) $this->validated('base_url');
|
||||
}
|
||||
|
||||
public function provider(): GitProviderKey
|
||||
{
|
||||
return GitProviderKey::from((string) $this->validated('provider'));
|
||||
}
|
||||
|
||||
private function normalizedBaseUrl(): string
|
||||
{
|
||||
$baseUrl = Str::of((string) $this->input('base_url'))
|
||||
|
||||
@@ -19,6 +19,13 @@ class UpdateUserGitConnectionRequest extends FormRequest
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'base_url' => $this->normalizedBaseUrl(),
|
||||
'provider' => Str::lower(trim((string) $this->input('provider'))),
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
@@ -47,30 +54,6 @@ class UpdateUserGitConnectionRequest extends FormRequest
|
||||
))],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'base_url' => $this->normalizedBaseUrl(),
|
||||
'provider' => Str::lower(trim((string) $this->input('provider'))),
|
||||
]);
|
||||
}
|
||||
|
||||
public function apiToken(): string
|
||||
{
|
||||
return (string) $this->validated('api_token');
|
||||
}
|
||||
|
||||
public function baseUrl(): string
|
||||
{
|
||||
return (string) $this->validated('base_url');
|
||||
}
|
||||
|
||||
public function provider(): GitProviderKey
|
||||
{
|
||||
return GitProviderKey::from((string) $this->validated('provider'));
|
||||
}
|
||||
|
||||
private function normalizedBaseUrl(): string
|
||||
{
|
||||
$baseUrl = Str::of((string) $this->input('base_url'))
|
||||
|
||||
Reference in New Issue
Block a user