Every time you save an Eloquent model, Laravel updates the updated_at timestamp.
Usually that's what you want, but not always.
For example, let's say your making a change to how data is stored in a JSON array column.
// before
$jsonField = ['is_premium' => 1];
// after
$jsonField = ['is_premium' => true];
You're going to run a conversion command to update all existing values to this new format.
But, now every single model will have a new updated_at value as well.
Is that really an "update" to the model? I say it's not. The content hasn't changed at all. This is just a technical implementation detail.
Laravel has a solution: withoutTimestamps.
use Illuminate\Database\Eloquent\Model;
Model::withoutTimestamps(
// your conversion logic here
);
Inside the closure, any model operations skip the timestamp update.
Now you can be intentional about what counts as a real modification.
Here to help,
Joel
P.S. The next time you're struggling with a problem, don't forget that the community and Get Unstuck sessions are here to help you out.