|
@@ -12,7 +12,7 @@ public function rules(): array
|
|
|
$isCreate = $this->isMethod('POST');
|
|
$isCreate = $this->isMethod('POST');
|
|
|
|
|
|
|
|
$rules = [
|
|
$rules = [
|
|
|
- 'unit_id' => 'sometimes|required|integer|exists:units,id',
|
|
|
|
|
|
|
+ 'unit_id' => 'sometimes|integer|exists:units,id',
|
|
|
'name' => 'sometimes|required|string|max:255',
|
|
'name' => 'sometimes|required|string|max:255',
|
|
|
'social_name' => 'sometimes|nullable|string|max:255',
|
|
'social_name' => 'sometimes|nullable|string|max:255',
|
|
|
'role' => 'sometimes|nullable|string|max:100',
|
|
'role' => 'sometimes|nullable|string|max:100',
|
|
@@ -35,9 +35,8 @@ public function rules(): array
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
if ($isCreate) {
|
|
if ($isCreate) {
|
|
|
- $rules['unit_id'] = 'required|integer|exists:units,id';
|
|
|
|
|
- $rules['name'] = 'required|string|max:255';
|
|
|
|
|
- $rules['cpf'] = ['required', 'string', 'max:20', Cpf::rule()];
|
|
|
|
|
|
|
+ $rules['name'] = 'required|string|max:255';
|
|
|
|
|
+ $rules['cpf'] = ['required', 'string', 'max:20', Cpf::rule()];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $rules;
|
|
return $rules;
|