I Want Register user with modal And Rapid Authentication,I'm Using Ajax for sent data. My Code is here:
<div class="modal fade" tabindex="-1" role="dialog" id="mySignup">
<div class="modal-dialog" role="document">
<div class="login-wrap">
<div class="form text-center">
<input type="text" name="name" id="name"/>
<input type="email" name="email" id="email"/>
<input type="password" name="pw" id="password"/>
<button id="SignUp">Signup</button>
</div>
</div>
{{csrf_field()}}
</div>
</div>
<script>
$(document).ready(function () {
$('#SignUp').click(function (event) {
var name = $('#name').val();
var email = $('#email').val();
var password =$('#password').val();
$.post('/register',{
'name' : name,
'email' :email,
'password':password,
'token':$('input[name=_token]').val()
});
});
});
</script>
And In Web.php I'm Using this code:
Route::post('/register',[
'as'=> '',
'uses' => 'Auth\RegisterController@Register'
]);
But When I Want SignUp I give this Error message with 419 status code
{message: "", exception: "Symfony\Component\HttpKernel\Exception\HttpException",…}
How I Can fix this problem?