@muazzamazaz can you supply the method you are posting to? does it have a redirect to another page with a form on it?
{{ csrf_field() }} added tokenmismatch exception
I am using html form for submitting data by using following field inside form as:
{{ csrf_field() }}
but it shows tokenmismatch error
TokenMismatchException in VerifyCsrfToken.php line 68:
There is an issue sometimes seen where if any content is output before the request terminates then it can stop cookies being sent to the client. As far as I know, this only affects apache. Your test with artisan serve suggests it might not be this problem.
Anyway, it might be worth checking. This is issue is caused by either;
- having some characters before
<?phpin any php file - using
?>at the end of a php file and then having some trailing data like a blank line.
I would have a quick look. Check your routes file(s), then service providers, then config files.
You are looking for anything - even a blank line, before <?php or if the previous developer has used ?> in any .php file (if so, delete it)
Please or to participate in this conversation.