I'm incrementing some total fields in my table
$model->total_comments += 1;
$model->save();
However this triggers the date to update for updated_at
. I want to disable it for these cases. I know I can do it manually and disable auto update for the the timestamp fields altogether. But hoping there is a simple way to do it.
EDIT:
Adding example from my code. Note that there are no Observers set on this model.
namespace App\Models;
class Language extends \Illuminate\Database\Eloquent\Model
{
}
$router->get('/test', function () {
$model = \App\Models\Language::find(1);
$model->words_total = $model->words_total + 1;
$model->save(['timestamps' => false]);
return 'boo';
});