| 123456789101112131415161718192021222324252627282930313233 |
- <?php
-
- namespace App\Http\Requests\Settings;
-
- use App\Concerns\ProfileValidationRules;
- use Illuminate\Contracts\Validation\ValidationRule;
- use Illuminate\Foundation\Http\FormRequest;
- use Illuminate\Support\Str;
-
- class ProfileUpdateRequest extends FormRequest
- {
- use ProfileValidationRules;
-
- /**
- * Prepare the data for validation.
- */
- protected function prepareForValidation(): void
- {
- if (config('fortify.lowercase_usernames') && is_string($this->input('email'))) {
- $this->merge(['email' => Str::lower($this->input('email'))]);
- }
- }
-
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array<string, ValidationRule|array<mixed>|string>
- */
- public function rules(): array
- {
- return $this->profileRules($this->user()->id);
- }
- }
|