@extends('layout/master2')

@section('contentchild')
    <style>

<?php 

//dd($cat);

?>


.help-block{
  color:red;
}
.is-invalid{border:1px solid red !important;}
      </style>          
<div class="row justify-content-center">
   <div class="col-lg-5">

    <div class="card shadow-lg border-0 rounded-lg mt-5">
      <div class="col-sm-12">
                         <h4 class="text-center font-weight-light my-4">Add Unit</h4>
									 
 
 @foreach(["success","error"] as $status)
@if(Session::has($status))
<div class="alert alert-{{$status}} alert-dismissible">
  <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
  <strong>{{$status}}!</strong> {{Session::get($status)}} action.
</div>
@endif
@endforeach
                                    <form  name="chngpwd" method="post" action="
                                    {{url('saveunit')}}">
                                  @csrf
                                  <input type="hidden" name="id" value="{{ !empty($cat->id)?$cat->id:''}}" />
                                      <div class="form-group">
                                            <label for="password">Unit</label>
<input id="unit" type="text"  name="unit" class="@error('unit') is-invalid @enderror form-control" autocomplete="off"  value="{{ !empty($cat->unit)?$cat->unit:''}}" >

 @if ($errors->has('unit'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('unit') }}</p>
        @endif
                                          </div>

   


<div class="col-sm-12 text-center">
<button type="submit" name="change" class="btn btn-primary" >Create</button>

</div>
 </form>
              </div>               
        </div>      
		</div>
		</div>



     @endsection
             