[Vuejs]-Post method fail with Vue.js "500 (Internal Server Error)"

0👍

You need to add CSRF token:
https://laravel.com/docs/5.4/helpers#method-csrf-token

For example in the view

<script>
  var csrf = '{{csrf_token()}}';
</script>

And in your script

var formData = new FormData();

formData.append('_token', csrf);
formData.append('input', this.newUserVoted);

this.$http.post('http://www.nmdad2-05-elector.local/api/v1/electionuser', formData)

Leave a comment