How to solve TokenMismatchException in Laravel 5.4 -
Whoops, looks like something went wrong. (1/1) TokenMismatchException in VerifyCsrfToken.php line 68 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate
use {!! csrf_field() !!}
@csrf
CSRF Tokens & JavaScript
When building JavaScript driven applications, it is convenient to have your JavaScript HTTP library automatically attach the CSRF token to every outgoing request. By default, the Axios HTTP library provided in the resources/js/bootstrap.js
file automatically sends an X-XSRF-TOKEN
header using the value of the encrypted XSRF-TOKEN
cookie. If you are not using this library, you will need to manually configure this behavior for your application.