laravel csrf token mismatch ajax code example
Example 1: laravel csrf token ajax post
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
Example 2: laravel-csrf-token-mismatch
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">