| 123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- use Illuminate\Support\Facades\Auth;
- use Illuminate\Validation\Rule;
- class UpdateMeRequest extends FormRequest
- {
- public function authorize(): bool
- {
- return true;
- }
- public function rules(): array
- {
- return [
- 'name' => 'sometimes|string|nullable|max:255',
- 'email' => ['sometimes', 'email', 'nullable', Rule::unique('users', 'email')->ignore(Auth::id())],
- 'phone' => 'sometimes|string|nullable',
- 'language' => 'sometimes|string|nullable',
- 'document' => 'sometimes|string|nullable',
- 'avatar' => 'sometimes|file|image|mimes:jpg,jpeg,png,webp|max:5120',
- ];
- }
- }
|