<form class="row g-3 auto-width editForm" action="{{ route('course-categories.update', $data->id)}}" method="post" enctype='multipart/form-data'>
    @csrf
    @method('PUT')
    <div class="col-md-12">
        <label for="validationCustomTitle" class="form-label">Title <span class="text-danger"><b>*</b></span></label>
        <input type="text" class="form-control" id="validationCustomTitle" name="title" aria-describedby="inputGroupPrepend" required value="{!! $data->title !!}">
        @if ($errors->has('title'))
        <span class="text-danger">{{ $errors->first('title') }}</span>
        @endif
        <span class="text-danger error_title" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-12">
        <label for="validationCustomOrder" class="form-label">Select Main Category</label>
        <select class="single-select-2 form-control" id="parent_id" name="parent_id" required>
            <option value=""> -- Select Main Category -- </option>
            @foreach ($categories as $key => $category)
            <option value="{!! $category->id !!}" {!! ($data->parent_id == $category->id) ? 'selected' : '' !!}>{!! $category->title !!}</option>
            @endforeach
            <option value="2"> 2</option>
        </select>
        @if ($errors->has('parent_id'))
        <span class="text-danger">{{ $errors->first('parent_id') }}</span>
        @endif
        <span class="text-danger error_name" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="validationCustomOrder" class="form-label">Priority <span class="text-danger"><b>*</b></span></label>
        <input type="number" value="{!! $data->sort_order !!}" class="form-control" id="validationCustomOrder" name="sort_order" aria-describedby="inputGroupPrepend" required>
        @if ($errors->has('sort_order'))
        <span class="text-danger">{{ $errors->first('sort_order') }}</span>
        @endif
        <span class="text-danger error_name" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-6" style="margin-top: 9%">
        <label for="validationCustomOrder" class="form-label">Is Featured </label>
        <input name="is_featured" class="form-check-inputFeaturedE btn-lg isFeatured2" type="checkbox" id="inlineCheckboxFeaturedE" value="1" {!! ($data->is_featured == 1) ? 'checked' : '' !!}>
        @if ($errors->has('is_featured'))
        <span class="text-danger">{{ $errors->first('is_featured') }}</span>
        @endif
        <span class="text-danger error_name" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-12">
        <label for="validationTextarea" class="form-label">Image (828x490)</label>
        <input type="file" class="form-control" name="image" aria-label="file example">
        <div class="invalid-feedback">Example invalid form file </div>
    </div>
    <div class="col-md-6">
        <label for="validationCustomMetaTitle" class="form-label">Meta Title </label>
        <input type="text" class="form-control" id="validationCustomMetaTitle" name="meta_title" aria-describedby="inputGroupPrepend" value="{!! $data->meta_title !!}" required>
        @if ($errors->has('meta_title'))
        <span class="text-danger">{{ $errors->first('meta_title') }}</span>
        @endif
        <span class="text-danger error_name" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="validationCustomMetaKeywords" class="form-label">Meta Keywords </label>
        <input type="text" class="form-control" id="validationCustomMetaKeywords" name="meta_keywords" aria-describedby="inputGroupPrepend" value="{!! $data->meta_keywords !!}" required>
        @if ($errors->has('meta_keywords'))
        <span class="text-danger">{{ $errors->first('meta_keywords') }}</span>
        @endif
        <span class="text-danger error_name" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-12">
        <label for="validationTextarea" class="form-label">Open Graph Image(1200x630)</label>
        <input type="file" class="form-control" name="open_graph_image" aria-label="file example">
        <div class="invalid-feedback">Example invalid form file </div>
    </div>
    <div class="col-md-12">
        <label for="validationCustomMetaDescription" class="form-label">Meta Description </label>
        <textarea class="form-control" id="validationCustomMetaDescription" name="meta_description" aria-describedby="inputGroupPrepend" required>{!! $data->meta_description !!}</textarea>
        @if ($errors->has('meta_description'))
        <span class="text-danger">{{ $errors->first('meta_description') }}</span>
        @endif
        <span class="text-danger error_name" style="display: none;">This field is required.</span>
    </div>
</form>