我在一个表中添加了两个字段。没什么特别的当我想保存()我的对象时,我得到了这个错误。
$annonce = new Annonce([
'user_id' => auth()->user()->id,
'slug' => uniqid(),
'is_active' => false,
'energie_ges' => $request->get('energie_ges'), //field i added
'energie_dpe' => $request->get('energie_dpe'),//field i added
'active_until' => Carbon\Carbon::now(),
]);
dd($annonce);//works
$saved = $annonce->save(); //create the exception我试着找了2个小时,但我不知道为什么。
我做了一个php artisan优化,没有任何改变。
谢谢
发布于 2019-12-28 04:20:54
我找到了。这很简单,只是我在迁移文件中添加的数据库字段的名称有误。
这很难找到,因为Laravel的错误是错误的。
https://stackoverflow.com/questions/59440184
复制相似问题