hi i am trying to post some values on drop down change and fetch data form database on the base of that value and return back the ajax response . like i want to get all branches of that specific company when i change company by drop-down, branches of that specif company displayed in drop down in a specific area but i am facing 500 (Internal Server Error). Always displays i am an error in console. My jQuery is
$(".select-company").dropdown({
onChange: function (val) {
var CSRF_TOKEN = $('meta[name="csrf-token"]').attr('content');
var id=val;
var urll = "promoplan/getcity";
$.ajax
({
type: "POST",
url: urll,
data: { company_id: id, _token: CSRF_TOKEN },
cache: false,
success: function(html)
{
console.log(html);
//$("#regions").html(html);
},
error: function()
{
console.log('i am an error');
}
});
}
});
My Route is
Route::post('promoplan/getcity','PromotionPlanController@getcity');
public function getcity(){ return Response::json("i am get city"); }
- Umair Mehmood