_Token error in laravel 4 when updating

I run the laravel 4 framework and I get Whoops! the error is only with the message "_token" when I try to update an instance of the eloquent model class. What does it mean? I use Form :: model to create a form, and I can update the records of other model classes.

-1
source share
2 answers

This is usually the result of either a missing or inconsistent CSRF token. If you have not placed a token in your form, do this by repeating the function "Form :: token ()" inside your form. Otherwise, I believe that this will be handled for you if you use the syntax "Form :: open ()" to open the form. You can learn more about this here: http://laravel.com/docs/html#csrf-protection

The token is stored as part of the user session, as it is possible you can get a token mismatch error if you store your sessions in the database and then wipe the database between receiving the form and sending it.

0
source

If I am not mistaken, the token is automatically added when using the :: open / Form :: model form. In this case, you are probably missing the $ fillable / $ array protected in your model.

You can read more about this here: http://laravel.com/docs/4.2/eloquent#mass-assignment

0
source

All Articles