e.herrera e.herrera - 1 year ago 111
PHP Question

TokenMismatchException in VerifyCsrfToken.php line 67:

I was following this tutorial https://laracasts.com/series/laravel-5-from-scratch/episodes/9 and per minute 11:15 I get this error. how I can correct this error?
enter image description here

Answer Source

I'm guessing the reason way Jeffery's code works is because the version of Laravel doesn't have default csrf protection, so if u want to make your form works, you have to manually add :

<input type="hidden" name="_token" value="{{ csrf_token() }}">

or create the form with the form helper:

{{ Form::open(array('url' => 'foo/bar')) }}
//
{{ Form::close() }}

which will automatically generate the hidden input tag of csrf token