Support the ongoing development of →
Views Forms Installation
Last updated 2 years ago.

I solved this actually.:

I put:

<input type="hidden" id="csrf_token" value="{{ csrf_token() }}"/>

in the view where the form is rendered.
Then I pulled out the value in js :

csrf_token = document.getElementById('csrf_token');

and put it in the form like this:

<input type="hidden" name="_token" value="'+csrf_token.value+'">\
Last updated 7 years ago.

How about sending it as a cookie? And then use a filter to check this cookie? If you mark your cookie as HTTP secure, then all request will send this. And you don't need to JavaScript worry about it.


Sign in to participate in this thread!


Your banner here too?

seki98 seki98 Joined 23 Aug 2016


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.