2016-05-30 53 views
0

我在我的表格中有数百个字段,我不愿t want to write all the field in the $ fillable array. Is there any way to bypass $ fillable process`?Bypass“mass assignement”laravel

class MyClass extends Eloquent { 

protected $fillable = array('firstField', 'secondField',.......); 

} 

回答

1

你可以做相反的方式:

指定把守属性(所有领域应该是可填写)。

protected $guarded = array('id', 'created_at', '...'); 

并完全删除$ fillable。