Quantumass soufiane Quantumass soufiane - 5 months ago 82
Ajax Question

MethodNotAllowedHttpException - CSRF -laravel 5.2

I'm using ajax to post a request then it refresh a part of the site with jquery function "load" and it's working good but when I try to redo this post it says MethodNotAllowedHttpException I think the problem in laravel csrf protection because after I refresh the whole page it works fine
my problem is how can I save the csrf token even if I refresh a part of site ?
** thanks in advance ** (ᵔᴥᵔ)


It is usually recommended to pass the csrf token to the web-page in meta tags (which are inside <head></head> tags)

 <meta name="_token" content="{{  csrf_token() }}" />