Add form request validation tests for various client and admin requests

This commit is contained in:
2026-09-21 05:24:50 +03:30
parent f77ff527e7
commit e987a528ef
21 changed files with 1061 additions and 23 deletions
+5 -3
View File
@@ -38,8 +38,10 @@ class PetRequest extends FormRequest
public function prepareForValidation()
{
$this->merge([
'weight' => PersianToEnglish::toEnglish($this->weight),
]);
if ($this->filled('weight')) {
$this->merge([
'weight' => PersianToEnglish::toEnglish($this->weight),
]);
}
}
}
+1 -1
View File
@@ -33,7 +33,7 @@ class UserRequest extends FormRequest
'phone' => ['required', 'max:255', new PhoneNumber],
'fullname' => 'nullable | max:255',
'role' => ['nullable', 'array', 'exists:roles,id'],
'profile_url' => ['nullable', 'exists:medium,url'],
'profile_url' => ['nullable', 'exists:media,url'],
'email' => ['nullable', 'email', 'max:255',
isset($toBeEditedUser)
? Rule::unique('users')->ignore($toBeEditedUser->id)