我有从导入日期从csv到数据库的问题因为日期的格式所以我使用了mutator但是我收到了错误消息:数据丢失
命名空间App;
use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;
class Checks extends Model
{
protected $table='checks';
protected $fillable=
['details','postingdate','desription','amonut','type','slip','name','job'];
protected $primaryKey='id';
public $timestamps=false;
public function setPostingdateAttribute($date) {
$this->attributes['postingdate'] = Carbon::createFromFormat('m/d/yyyy', $date)->format('yyyy-mm-dd');
}
}