AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProfileUpdateRequest.php 839B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Requests\Settings;
  3. use App\Concerns\ProfileValidationRules;
  4. use Illuminate\Contracts\Validation\ValidationRule;
  5. use Illuminate\Foundation\Http\FormRequest;
  6. use Illuminate\Support\Str;
  7. class ProfileUpdateRequest extends FormRequest
  8. {
  9. use ProfileValidationRules;
  10. /**
  11. * Prepare the data for validation.
  12. */
  13. protected function prepareForValidation(): void
  14. {
  15. if (config('fortify.lowercase_usernames') && is_string($this->input('email'))) {
  16. $this->merge(['email' => Str::lower($this->input('email'))]);
  17. }
  18. }
  19. /**
  20. * Get the validation rules that apply to the request.
  21. *
  22. * @return array<string, ValidationRule|array<mixed>|string>
  23. */
  24. public function rules(): array
  25. {
  26. return $this->profileRules($this->user()->id);
  27. }
  28. }