mardi 5 mars 2019

Get 405 method not allowed error in laravel

Calling ajax function but getting error 405 method not allowed .

error:

home/asif/fanslive/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php.

Request Method: POST

Status Code: 405 Method Not Allowed

Remote Address: 192.168.0.4:80

Referrer Policy: no-referrer-when-downgrade

Here is code.please provide solution.

window.ajaxCall = function (url, data, method, dataType, successHandlerFunction, processDataFlag, contentTypeFlag) {
if(typeof(processDataFlag) == 'undefined'){
  processDataFlag = true;
}
if(typeof(contentTypeFlag) == 'undefined'){
  contentTypeFlag = 'application/x-www-form-urlencoded';
}
$(".js-data-table .overlay").show();
geturl = $.ajax({
    url: url,
    data: data,
    processData: processDataFlag,
    contentType: contentTypeFlag,
    type: method,
    dataType: dataType,
    cache: false,
    success: successHandlerFunction,
    headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
    complete: function() {
        $(".js-data-table .overlay").hide();
    }
});
}

var data = "latitude=54&longitude=21&id=1"';
ajaxCall("getGenralSettingData", data, 'POST', 'json','');
Route::group(['prefix' => '{club}',  'middleware' => ['check.cms.panel']], function()
{
    Route::post('/getGenralSettingData', 'SampleController@getGenralSettingData')->name('backend.sample.data');
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire