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.

23 lines
615 B

  1. <?php
  2. namespace App\Http\Requests;
  3. use App\Models\User;
  4. use Illuminate\Foundation\Http\FormRequest;
  5. use Illuminate\Validation\Rule;
  6. class ProfileUpdateRequest extends FormRequest
  7. {
  8. /**
  9. * Get the validation rules that apply to the request.
  10. *
  11. * @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
  12. */
  13. public function rules(): array
  14. {
  15. return [
  16. 'name' => ['required', 'string', 'max:255'],
  17. 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
  18. ];
  19. }
  20. }