@extends('dashboardLayout.main')   
@section('main-section')  <div class="content container-fluid">
  <div class="row">
    <div class="col-sm-12">
      <div class="card">
        <div class="card-header card-buttons">
          <h5 class="card-title">Edit State</h5>
        </div>
        <div class="card-body card-buttons">
          <div class="row">
            <div class="col-sm-12">
                @if(Session::has('success'))
                    <div class="alert alert-success">{{Session::get('success')}}</div>
                @endif @if(Session::has('fail')) 
                    <div class="alert alert-danger">{{Session::get('fail')}}</div>
                @endif
            </div>
            <div class="col-sm">
              <form action="{{ route('state.updateState', ['id' => $state->area_id]) }}" method="post">
                  @csrf
                <div class="form-row row">
                  <div class="col-md-4 mb-3">
                    <label for="validationCustom01">state name</label>
                    <input type="text" class="form-control" name="name" id="name" value="{{$state->name?$state->name:old('name')}}" placeholder="state name">
                    <span class="text-danger">@error('name') {{$message}} @enderror </span>
                  </div>
                </div>
                <button class="btn btn-primary" type="submit">Update</button>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div> @endsection