I try to update data using ajax and laravel it working in local but in production, it's given me an error (The requested URL /appointment/45/edit was not found on this server)
I am using ajax, laravel 5.7
$(document).on('click', '.edit', function() {
id = $(this).attr('id');
$.ajax({
url: "/appointment/" + id + "/edit",
dataType: "json",
success: function(html) {
$('#name').val(html.data.name);
$('#appdate').val(html.data.appdate);
$('.modal-title').text("Edit Appointment");
$('#action_button').val("Edit");
$('#action').val("Edit");
$('#modal-default').modal('show');
}
})
});
route
Route::resource('appointment','AppointmentController');
controller
public function edit($id)
{
if(request()->ajax())
{
$data = Appointment::findOrFail($id);
return response()->json(['data' => $data]);
}
}
The requested URL /appointment/45/edit was not found on this server
I try to update data using ajax and laravel it working in local but in production, it's giving me an error (The requested URL /appointment/45/edit was not found on this server)