jeudi 15 mars 2018

laravel 500 internal server error post ajax

i want to submit my form using ajax following is my javascript

$.ajax({

      type: "POST",
      headers: {
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  }
      url: "http://localhost/shago/register/submit",
      data: user_firstname,

      dataType: "text",
      success: function(resultData) { alert("Save Complete") }
});

i have included meta tag in form like

<div id="individual" class="hid">
<form method="POST" id="individual_form" name="individual_form" action="">
<meta name="csrf-token" content="">

and in controller i have just returned a message but i am getting

app.js:1 POST http://localhost/shago/register/submit 500 (Internal Server Error)

above error can you please help me ,let me know for any other inputs i know it is mostly caused by csrf token (i have declared submit route in web.php and also api.php file)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire