执行函数
<code>public function registerStore(Requests\RegisterRequest $request){ $user=User::user(); $res=$user->update($request->all()); return redirect('/'); }</code>
User.php
<code> 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', ]; </code>
就是很普通的更新,user数据已经有了的。
6.24更新,我讲user表中crated_at字段的extra值设为null,似乎就好了,之前是on update CURRENT_TIMESTAMP
执行函数
<code>public function registerStore(Requests\RegisterRequest $request){ $user=User::user(); $res=$user->update($request->all()); return redirect('/'); }</code>
User.php
<code> 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', ]; </code>
就是很普通的更新,user数据已经有了的。
6.24更新,我讲user表中crated_at字段的extra值设为null,似乎就好了,之前是on update CURRENT_TIMESTAMP
似乎有其他人碰到這種問題:https://github.com/laravel/framework/issues/11518
試試看建立 migration
時
<code class="php">$table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent();</code>
或是
<code class="php">$table->nullableTimestamps();</code>