[Laravel 8] Eloquent Modelのfillableとguarded
It is necessary to specify either a fillable or guarded property on your model class. These properties are required because all Eloquent models are protected against mass assignment vulnerabilities by default.
$fillable
To get started, you should define which model attributes you want to make mass assignable. You may do this using the $fillable property on the model.
protected $fillable = ['first_name','last_name'];
$guarded
If you would like to make all of your attributes mass assignable, you may define your model's $guarded property as an empty array.
protected $guarded = [];
Reference:
https://laravel.com/docs/8.x/eloquent#mass-assignment
Author And Source
この問題について([Laravel 8] Eloquent Modelのfillableとguarded), 我々は、より多くの情報をここで見つけました https://qiita.com/bell_doggy/items/52f6bf0b368d85380806著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .