Merge branch 'trunk'

This commit is contained in:
Noah Lancien 2025-04-24 15:02:27 +02:00
commit fb8720d41b
2 changed files with 14 additions and 1 deletions

View file

@ -19,6 +19,18 @@ class StoreUserRequest extends FormRequest
return Gate::allows('isAdmin');
}
/**
* Prepare the data for validation.
*
* @return void
*/
protected function prepareForValidation(): void
{
$this->merge([
'gitlab_id' => \boolval($this->input('gitlab_id')) ? $this->input('gitlab_id') : null
]);
}
/**
* Get the validation rules that apply to the request.
*

View file

@ -12,7 +12,8 @@ class UpdateUserRequest extends StoreUserRequest
public function rules()
{
return array_merge(parent::rules(), [
'email' => 'email|required|unique:users,email,' . $this->route('user')->id . ',id',
'email' => 'email|required|unique:users,email,' . $this->route('user')->id . ',id',
'gitlab_id' => 'nullable|integer|unique:users,gitlab_id,' . $this->route('user')->id . ',id'
]);
}
}