$.ajax({
url: "{{url('urlname')}}",
type: "get",
data: {
data:'id',
},
success: function(response) {
console.log(response);
},
error: function(xhr) {
//Do Something to handle error
}});
/////////web//////////
Route::get('urlname', 'Controller@urlname')->name('urlname');
///controller//////////
public function urlname(Request $request){
return $request->id;
}