laravel 4上的_token错误更新 [英] _token error in laravel 4 on update
问题描述
我正在运行一个laravel 4框架,我得到了一个呐喊!当我尝试更新雄辩的模型类的实例时,仅出现消息"_token"错误.这是什么意思?我使用Form :: model创建表单,并且能够更新其他模型类的记录.
I am running a laravel 4 framework and I get a Whoops! error with just the message "_token" when I try to update an instance of an eloquent model class. What does this mean? I use Form::model to create the form and I am able to update records of other model classes.
推荐答案
如果我没记错的话,当您使用Form :: open/Form :: model时会自动添加令牌. 在这种情况下,您的模型中可能缺少$ fillable/$ guarded数组.
If I am not mistaken, token is automaticly added when you use Form::open / Form::model. In this case you are probally missing array $fillable/$guarded in your model.
您可以在此处了解更多信息: http://laravel.com/docs/4.2/eloquent#mass-assignment
You can read more about this here: http://laravel.com/docs/4.2/eloquent#mass-assignment
这篇关于laravel 4上的_token错误更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!