Eloquent model not updating updated_at timestamp

后端 未结 5 1493
北海茫月
北海茫月 2021-02-12 14:19

I\'m using Laravel 5.1. To make it simple, I have the following code

Migration:

Schema::create(\'sitemap_data\', function (Blueprint $table) {
    // Pri         


        
5条回答
  •  [愿得一人]
    2021-02-12 15:08

    This is not the case in the question, but same issue will happen if you're using Query Builder instead of Eloquent Model.

    If you do

    DB::table('users')->where()->update()
    

    instead of

    User::where()->update()
    

    updated_at will not be updated.

提交回复
热议问题