时间:2021-07-01 10:21:17 帮助过:7人阅读
public function registerStore(Requests\RegisterRequest $request){
$user=User::user();
$res=$user->update($request->all());
return redirect('/');
}
User.php
protected $fillable = [
'name', 'email', 'password', 'openid','user_id','truename','tel','card','bank_name','bank_branch'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
就是很普通的更新,user数据已经有了的。
6.24更新,我讲user表中crated_at字段的extra值设为null,似乎就好了,之前是on update CURRENT_TIMESTAMP
执行函数
public function registerStore(Requests\RegisterRequest $request){
$user=User::user();
$res=$user->update($request->all());
return redirect('/');
}
User.php
protected $fillable = [
'name', 'email', 'password', 'openid','user_id','truename','tel','card','bank_name','bank_branch'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
就是很普通的更新,user数据已经有了的。
6.24更新,我讲user表中crated_at字段的extra值设为null,似乎就好了,之前是on update CURRENT_TIMESTAMP
似乎有其他人碰到這種問題:https://github.com/laravel/framework/issues/11518
試試看建立 migration
時
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
或是
$table->nullableTimestamps();