@extends('admin.admin_master')
@section('admin')


<div class="page-content">
<div class="container-fluid">

<div class="row">
<div class="col-12">
    <div class="card">
        <div class="card-body">

            <h4 class="card-title">Edit Category Page </h4><br><br>


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

                <input type="hidden" name="id" value="{{ $categories->id }}">

            <div class="row mb-3">
                <label for="example-text-input" class="col-sm-2 col-form-label">Unit Name </label>
                <div class="col-sm-10">
                    <input name="name" class="form-control" type="text" value="{{ $categories->name }}">
                </div>
            </div>
            <!-- end row -->


<input type="submit" class="btn btn-info waves-effect waves-light" value="Update Category">
            </form>



        </div>
    </div>
</div> <!-- end col -->
</div>



</div>
</div>


<script type="text/javascript">

    $(document).ready(function(){
        $('#myForm').validate({
            rules : {
                name : {
                    required : true,
                },
                mobile_no : {
                    required : true,
                },
                address : {
                    required : true,
                },
                item : {
                    required : true,
                },
            },

            messages : {
                name : {
                    required : 'Name is mandatory',
                },
                mobile_no : {
                    required: 'Mobile number is mandatory',
                },
                address : {
                    required : 'Address is mandatory',
                },
                item : {
                    required : 'Item is mandatory',
                },
            },

            errorElement : 'span',
            errorPlacement : function(error, element) {
                element.addClass('invalid-feedback');
                $(element).errorclosest('.form-group').append(error);
            },

            highlight : function(element, errorClass, validClass) {
                error.addClass('is-invalid');
            },

            unhighlight : function(element, errorClass, validClass) {
                error.removeClass('is-invalid');
            },
        });

    });

</script>



@endsection 