<p>Update your account's profile information and email address.</p>

<form
  id="send-verification"
  method="post"
  action="{{ route('verification.send') }}"
>
  @csrf
</form>

<form method="post" action="{{ route('profile.update') }}">
  @csrf
  @method('patch')

  <div class="field-row">
    <label for="name">Name</label>
    <input
      id="name"
      name="name"
      type="text"
      value="{{ old('name', $user->name) }}"
      required
      autofocus
      autocomplete="name"
    />
    <x-input-error :messages="$errors->get('name')" />
  </div>

  <div class="field-row">
    <label for="email">Email</label>
    <input
      id="email"
      name="email"
      type="email"
      value="{{ old('email', $user->email) }}"
      required
      autocomplete="username"
    />
    <x-input-error :messages="$errors->get('email')" />

    @if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && ! $user->hasVerifiedEmail())
      <div>
        <p>
          Your email address is unverified.

          <button form="send-verification">
            Click here to re-send the verification email.
          </button>
        </p>

        @if (session('status') === 'verification-link-sent')
          <p>A new verification link has been sent to your email address.</p>
        @endif
      </div>
    @endif
  </div>

  <div>
    <button>Save</button>

    @if (session('status') === 'profile-updated')
      <p>Saved.</p>
    @endif
  </div>
</form>
