<form class="row g-3 auto-width relatives" action="{{ route('book.image.update', $data->id)}}" method="post" enctype='multipart/form-data'>
    <!-- For validation comment on -->
    <!-- <form class="row g-3 was-validated"> -->
    @csrf
    @method('PUT')
    <div class="col-md-12">
        <label class="form-label">Image Type <span class="text-danger"><b>*</b></span></label>
        <select class="single-select form-control" id="relation_type" name="image_type" required>
            <option value="thumbnail" {!! ($data->image_type == 'thumbnail') ? 'selected' : '' !!}>Thumbnail</option>
            <option value="cover" {!! ($data->image_type == 'cover') ? 'selected' : '' !!}>Cover</option>
            <option value="banner" {!! ($data->image_type == 'banner') ? 'selected' : '' !!}>Banner</option>
            <option value="otherimages" {!! ($data->image_type == 'otherimages') ? 'selected' : '' !!}>Other</option>
        </select>
        <span class="text-danger error_address_type_id" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-12">
        <label for="image_url" class="form-label">Image <span class="text-danger"><b>*</b></span></label>
        <input type="file" name="image_url" class="form-control">
        @if ($data->image_url != '')
        <img src="{!! getTempUrl($data->image_url) !!}" height="auto" id="createImage" data-bs-toggle="modal" data-bs-target="#commonModal" style="cursor: pointer;max-width: 120px;width: 120px;">
        @endif
    </div>
</form>