500 Internal Server Error Also After Checking CSRF Protection

I'm still having problems with submitting a form via AJAX in a Laravel project. I tried following some tutorials about submitting tokens with an AJAX request in Laravel, but I'm still having the error 500 (internal server error)

This is my script

$(document).on('click',"#registra_fornitore",function() {
    url: '/fornitori/create',
    method: "POST",
    data: {
        '_token': $('#_tokenSF').val(),
    dataType: "json",
    success: function(data){

This is the HTML for the form

<div class="form-group">
    <label for="nameSF">Nome</label>
    <input type="text" class="form-control" id="nameSF" placeholder="Nome">
<div class="form-group">
    <label for="nitSF">NIT</label>
    <input type="text" class="form-control" id="nitSF" placeholder="NIT">
<input type="hidden" id="_tokenSF" value="{{ Session::token() }}">
<button type="button" class="btn btn-default" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-primary" id="registra_fornitore">Registra</button></form>

And this is the routes file

Route::group(['middleware' => ['web']], function () {
Route::get('/', function () {
    return view('home');

Route::get('insert/{scope}','[email protected]');
Route::post('fornitori/create','[email protected]');});

Any ideas of the problem? I tried also the different approach, writing the token value in a meta tag in the header of my template, and passing it in the ajaxsetup



Sorry, I found out the problem was a misspelling error in the storing method in the controller.