<form class="row g-3 auto-width page_content" action="{{ route('page-content.getPage.content.update',$pageContent->id)}}" method="post" enctype='multipart/form-data'>
    @csrf
    <input type="hidden" name="id" data-id="{!! $id !!}" value="{!! $id !!}">
    <div class="col-md-12">
        <label for="content_type" class="form-label">Page Content Type <span class="text-danger"><b>*</b></span></label>
        <select class="form-control content_type" name="content_type">
            <option value="">Select Page Content Type</option>
            <option value="Content Category" {!! $pageContent->content_type=='Content Category'?'selected': '' !!}>Content Category</option>
            <option value="Photo Gallery" {!! $pageContent->content_type=='Photo Gallery'?'selected': '' !!}>PHOTO GALLERY</option>
            <option value="Video Gallery" {!! $pageContent->content_type=='Video Gallery'?'selected': '' !!}>VIDEO GALLERY</option>
        </select>
    </div>
    <div class="col-md-12">
        <label for="file" class="form-label">Content Title <span class="text-danger"><b>*</b></span></label>
        <select class="form-control" name="content_id" id="content_id">
            <option value=" ">Select Content Title</option>
            @foreach($category as $row)
            <option value="{{$row->id}}" {!! $pageContent->content_id==$row->id ? 'selected' : ''  !!}>{{$row->title}}</option>
            @endforeach
        </select>
        <span class="text-danger error_file" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-12">
        <label for="file" class="form-label">Priority <span class="text-danger"><b>*</b></span></label>
       <input type="text" name="priority" class="form-control" placeholder="Please Enter Priority" value="{{$pageContent->priority}}">
        <span class="text-danger error_file" style="display: none;">This field is required.</span>
    </div>
</form>
<script>

$('body').on('change', '.content_type', function(){
var content_type = $(this).val();
$.ajax({
          url: "{{route('page-content.getPage.content')}}",
          data:{content_type:content_type},
          success: function(data) {
            $('#content_id').html('');
            $('#content_id').html(data);
          }
        })
});
</script>