feat: ations
This commit is contained in:
@@ -15,6 +15,11 @@ class UpdateUserRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'avatar' => ['sometimes', 'nullable', 'image', 'max:2048'],
|
||||
'nutritionGoals' => ['sometimes', 'array'],
|
||||
'nutritionGoals.calories' => ['required_with:nutritionGoals', 'integer', 'min:0', 'max:100000'],
|
||||
'nutritionGoals.proteins' => ['required_with:nutritionGoals', 'numeric', 'min:0', 'max:10000'],
|
||||
'nutritionGoals.carbs' => ['required_with:nutritionGoals', 'numeric', 'min:0', 'max:10000'],
|
||||
'nutritionGoals.fats' => ['required_with:nutritionGoals', 'numeric', 'min:0', 'max:10000'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -22,6 +27,10 @@ class UpdateUserRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'avatar.max' => "L'image ne doit pas dépasser 2 Mo.",
|
||||
'nutritionGoals.calories.integer' => 'Les calories doivent etre un nombre entier.',
|
||||
'nutritionGoals.*.required_with' => 'Renseigne tous les objectifs nutritionnels.',
|
||||
'nutritionGoals.*.min' => 'Les objectifs nutritionnels doivent etre positifs.',
|
||||
'nutritionGoals.*.max' => 'La valeur de cet objectif nutritionnel est trop elevee.',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user