Disable Laravel's Eloquent timestamps

后端 未结 10 1475
余生分开走
余生分开走 2020-12-04 08:54

I\'m in the process of converting one of our web applications from CodeIgniter to Laravel. However at this moment we don\'t want to add the updated_at / c

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 09:31

    If you are using 5.5.x:

    const UPDATED_AT = null;
    

    And for 'created_at' field, you can use:

    const CREATED_AT = null;
    

    Make sure you are on the newest version. (This was broken in Laravel 5.5.0 and fixed again in 5.5.5).

提交回复
热议问题