I am using the standard updated_at
and created_at
on a table.
My results are ordered by updated_at
since they can be edited.
However, on a page I am updating a row counter (views). This means that the updated_at
will be updated with the new date/time but I want to prevent this.
Is there any way to do this? Or am I going to have to use created_at
to order my results?
I would rather not use my own manual created_at
and updated_at
For single model queries:
$product->timestamps = false;
$product->save();
For multiple model queries use
DB::table('products')->...->update(...)
instead of
Product::...->update(...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With