QueryException in Connection.php line 647: SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value (SQL: insert into matches (deal_id) values (1))我的守卫是一个空数组,可能是什么问题?I have my guarded to be an empty array, what could be the problem?推荐答案移除 guarded 数组并添加 fillable 代替:Remove the guarded array and add the fillable instead:protected $fillable = ['user_id', 'deal_id']; 这篇关于Laravel 5.4 字段没有默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-23 18:29