I am developing a ticket booking system in laravel. That will allow users to booked their seats. Now I want to disable those seats that was previously booked by some other user. Booked seats number are already passed in the blade through an array. The seat buttons are dynamically generated based on total seat number. I want to disable those booked seats by their value. Like A1,A2 are booked so buttons that contains value A1 & A2 will be disabled. Here is my HTML code
<form class="form-control" style="width: auto">
<div class="btn-group btn-group-sm" id="col1Buttons" style="display: inline-grid; padding: 10px;">
</div>
<div class="btn-group btn-group-sm" id="col2Buttons" style="display: inline-grid; margin-right: 15px;">
</div>
<div class="btn-group btn-group-sm" id="col3Buttons" style="display: inline-grid; margin-left: 15px;">
</div>
<div class="btn-group btn-group-sm" id="col4Buttons" style="display: inline-grid; padding: 10px;">
</div>
</form>
//{{$all_seats}} contains all booked seats//
javascript code for appending seat buttons
<script>
var pages = {{$seat_number/4}};
// console.log(pages);
var page1Buttons = $('#col1Buttons');
var page2Buttons = $('#col2Buttons');
var page3Buttons = $('#col3Buttons');
var page4Buttons = $('#col4Buttons');
for (var j=65; j<65+pages; j++){
page1Buttons.append('<input class="btn single_seat" name="options" type="button" id="seat" value="' + String.fromCharCode(j) + '' + 1 + '"/>');
page2Buttons.append('<input class="btn single_seat" name="options" type="button" id="seat" value="' + String.fromCharCode(j) + '' + 2 + '"/>');
page3Buttons.append('<input class="btn single_seat" name="options" type="button" id="seat" value="' + String.fromCharCode(j) + '' + 3 + '"/>');
page4Buttons.append('<input class="btn single_seat" name="options" type="button" id="seat" value="' + String.fromCharCode(j) + '' + 4 + '"/>');
}