I have a vue template that contains a form:
<form id="logout-form" :action="href" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
In laravel, forms must have a csrf_field() defined. But within a vue component, the statement {{ csrf_field() }}
means that I have a method named csrf_field
in my vue instance and I am calling it.
How do I add csrf_field under this circumstance?
headers['X-CSRF-TOKEN']
.And also store it into into the meta tag of your app, and later on just get it for instance withdocument.querySelector
. – Soni