<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title></title>
  <link
    href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
    rel="stylesheet"
  >
</head>

<body>
  <div class="container mt-2">
    <div class="row">
      <div class="col-lg-12 margin-tb">
        <div class="pull-left">
          <h2>Edit Apple</h2>
        </div>
        <div class="pull-right">
          <a
            class="btn btn-primary"
            href="{{ route('apples.index') }}"
            enctype="multipart/form-data"
          >
            Back</a>
        </div>
      </div>
    </div>
    @if (session('status'))
      <div class="alert alert-success mb-1 mt-1">
        {{ session('status') }}
      </div>
    @endif
    <form
      action="{{ route('apples.update', $apple->id) }}"
      method="POST"
      enctype="multipart/form-data"
    >
      @csrf
      @method('PUT')
      <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
          <div class="form-group">
            <strong>Apple Name:</strong>
            <input
              class="form-control"
              name="name"
              type="text"
              value="{{ $apple->name }}"
              placeholder="Apple name"
            >
            @error('name')
              <div class="alert alert-danger mb-1 mt-1">{{ $message }}</div>
            @enderror
          </div>
        </div>
        <div class="col-xs-12 col-sm-12 col-md-12">
          <div class="form-group">
            <strong>Apple Email:</strong>
            <input
              class="form-control"
              name="email"
              type="email"
              value="{{ $apple->email }}"
              placeholder="Apple Email"
            >
            @error('email')
              <div class="alert alert-danger mb-1 mt-1">{{ $message }}</div>
            @enderror
          </div>
        </div>
        <div class="col-xs-12 col-sm-12 col-md-12">
          <div class="form-group">
            <strong>Apple Address:</strong>
            <input
              class="form-control"
              name="address"
              type="text"
              value="{{ $apple->address }}"
              placeholder="Apple Address"
            >
            @error('address')
              <div class="alert alert-danger mb-1 mt-1">{{ $message }}</div>
            @enderror
          </div>
        </div>
        <button
          class="btn btn-primary ml-3"
          type="submit"
        >Submit</button>
      </div>
    </form>
  </div>
</body>

</html>
