在laravel 5.2中遇到了问题.
以下是eloquent创建操作(后调用)期间的错误,
Model.php 453中的批量分配异常:column_name
以下是要考虑的先决条件:
public function __construct() {
$this->fillable(\Schema::getColumnListing($this->getTable()))
}
以下是到目前为止调试的方法:
在插入之前,在控制器中,$ model :: getillableField()给出了适当的可填充数组.
在model.php行(450)中,
if ($this->isFillable($key)) {
$this->setAttribute($key, $value);
}
上面的代码返回值为"false",$ model :: getFillableField()在数组列表中有column_name.
用表格列硬编码$ fillable变量会删除错误.请帮忙,我哪里出错了,解决方案是什么?
提前致谢.