0đź‘Ť
As per your “XHR Error”, it means that when you’re making a post request you’re not sending CSRF Token.
As per laravel routing rules, middleware comes in action, and among different middleware there is ValidateCSRFToken. Which is checking if you’re sending valid CSRF token.
Kindly add that to your AJAX request.
See, if that works.
- [Vuejs]-ERROR Failed to compile with 1 errors This dependency was not found:
- [Vuejs]-VueJS slots with v-for loop do not display proper elements
0đź‘Ť
You need to send the CSRF token.
Add this in the HEAD element:
<meta name="csrf-token" content="{{ csrf_token() }}">
If you use jQuery:
<script>$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});</script>
- [Vuejs]-Vuejs changes order of json_encoded array, when decodes it back from props in vuejs component
- [Vuejs]-Access method or property from parent within a non named slot in vuejs component
Source:stackexchange.com