我想用ajax向控制器发送数据,但是有错误
Missing required parameters for `[Route: city] [URI: daftar / city / {id}].
这是我的ajax代码
$(".province").on("change",function(){
var id = this.value;
console.log(id);
$.ajax({
type: "get",
url: "{{ route('city') }}"+'/'+id ,
dataType: "json",
success: function(data){
console.log('');
},
});
});
这是我的路线
Route::group(['prefix' => 'vendor'], function () {
Route::get('/city/{id}', 'Vendor\VendorController@getCity')->name('city');
});
慕桂英3389331
蝴蝶刀刀
DIEA