Reputation: 9
I tried to do the custom POST request in Laravel without form, therefore I get error:
TokenMismatchException in VerifyCsrfToken.php line 68:
So, how can I fix it?
Upvotes: 1
Views: 402
Reputation: 21681
Add this to the form in your view:
<input type="hidden" name="_token" value="{{ csrf_token() }}">
It should solve this.
Upvotes: 0
Reputation: 163768
You should add token to the request:
{{ csrf_field() }}
If you're using Ajax, read this.
Upvotes: 3