2016-05-30 4 views
0

私はテーブルに何百ものフィールドを持っていますが、私はt want to write all the field in the $ fillable array. Is there any way toバイパス$ fillable process`ですか?"mass assignment"を無視してください。

class MyClass extends Eloquent { 

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

} 

答えて

1

あなたはそれを逆の方法を行うことができます:

が守られた属性(が充填可能であってはならないすべてのフィールド)を指定します。

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

$ fillableを完全に削除します。

関連する問題