8月 092022
因为数据表不是通过Laravel的migration建的,所以没有updated_at字段
使用Model对象save的时候就会报上面的错误,解决方法就是在Model里增加const UPDATED_AT = null;,如下代码所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?php namespace App; use Illuminate\Database\Eloquent\Model; class AidEvent extends Model { const UPDATED_AT = null; const CREATED_AT = null; function getTable() { return "aidevents"; } } |
Sorry, the comment form is closed at this time.