rester icon indicating copy to clipboard operation
rester copied to clipboard

protected $fillable=['*']不起作用

Open Ernest-su opened this issue 12 years ago • 1 comments

Illuminate\Database\Eloquent\model.php中:
public function totallyGuarded() { return count($this->fillable) == 0 && $this->guarded == array('*'); }

Ernest-su avatar Nov 24 '14 14:11 Ernest-su

嗯啦,这个可能是我忘记删除了,Model批量赋值权限只有两种情况:

  1. fillable指定哪些可以批量赋值,必须一个个列出来
  2. guarded是黑名单,哪些不让赋值,如果 guarded为array(*)那么就是全部都允许了。

overtrue avatar Nov 24 '14 14:11 overtrue