28 lines
495 B
PHP
28 lines
495 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateUserRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'avatar' => ['sometimes', 'nullable', 'image', 'max:2048'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'avatar.max' => "L'image ne doit pas dépasser 2 Mo.",
|
|
];
|
|
}
|
|
}
|