0

I have the csrf which it's already attached to the axios header at bootstap.js, I get always this response from server when try to post simple post (they are three pictures below explaining my situation)

axios post from vue file:
axios post from vue file

Route at web.php:
Route at web.php

result 1:
result 1

result 2:
result 2

Nimantha
  • 6,405
  • 6
  • 28
  • 69
K.33s
  • 51
  • 1
  • 9

1 Answers1

3

Try this, it works for me so far but you'll be without CSRF, go to 'App\Http\Middleware\VerifyCsrfToken' then edit the protected variable to this

 protected $except = [
     "/*"
 ];

the '/*' says to exclude CSRF from all routes, although this isn't ideal it should fix the problem, Maybe just exclude those specific routes that are throwing you the error?

e.g. "/specificRoute"

Kenziiee Flavius
  • 1,918
  • 4
  • 25
  • 57