samedi 27 avril 2019

Laravel 5.8: Internal Server error 500 - Ajax request -

I am trying to send some values to a controller using an ajax request. Below the code I am using. After clicking on the related button I get following error:
500 (Internal Server Error)

What I am doing wrong?

//ROUTE
Route::post('/checkEmail', 'MemberController@checkEmail')->name('check-email');

//TAG
<meta name="csrf_token" content="" />

  $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')
                }
            });


jQuery.ajax({
                url: "",
                method: 'post',
                data: {
                    username: jQuery('#username').val(),
                    email: jQuery('#email').val()
                },
                dataType: "json",
                success: function(result) {


                       //SOME CODE







                }

                });



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2GEK8OU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire