Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel 4 Basics Blade & Forms Form Builder

Ryan Meyer
Ryan Meyer
6,927 Points

Laravel 5 - TokenMismatchException in VerifyCsrfToken.php line 46:

Whoops, looks like something went wrong. 1/1 TokenMismatchException in VerifyCsrfToken.php line 46:

I received this error message when trying to POST the first form that Hampton built when it was suppose to return "creating a new list"

1 Answer

Ryan Meyer
Ryan Meyer
6,927 Points

I had to add an extra line to the form that Hampton magically created in this video. Laravel now requires a token to be sent when using the POST method in forms.

<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
uxeric
uxeric
6,263 Points

To know why you need to do this, you can check out this video for a good explanation of Cross Site Request Forgery.