<!DOCTYPE html>
<head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
<body>
<button class="edit">Edit</button>
<body>
</html>
<head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
<body>
<button class="edit">Edit</button>
<body>
</html>
web.php
Route::get('/flight/booking/show/{id}/{mode}', [ FlightController::class, 'show'])->name('flight.show');
$('body').on('click', '.edit',function(){
let recId = $(this).data('red_id');
let mode = $(this).data('mode');
let url = "{{ route('flight.show', ['id' => ':id', 'mode'=>':mode']) }}";
url = url.replace(':id', recId);
url = url.replace(':mode', mode);
$.ajax({
url: url,
type: 'GET',
beforeSend : function(){
},
done: function(){
/* AFTER SUBMIT COMPLETE ENABLE SUBMIT BUTTON */
},
success: function(resp) {
},
error: function(jqXHR, textStatus, errorThrown) {
if(jqXHR.status == 422){
let response = JSON.parse(jqXHR.responseText);
}
}
})
})
0 comments:
Post a Comment