Get the App
SLTechnology News&Howtos  ›  Development  › 

How Laravel updates the timestamps of the parent table

Shulou Source: shulou.com Published: 2022-06-01 04:38:33 09月22日 Update

This article mainly introduces how Laravel updates the timestamps of the parent table, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

Update the timestamps of the parent table

If you want to update the timestamps of the parent table while updating the associated table, you only need to add the touches attribute to the model of the associated table.

For example, we have two correlation models, Post and Comment.

Tags: Updates articles associations simultaneous two values interests attributes more friends models knowledge editing industry information information channels channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Docker Shulou Tech Info Linux Xiaomi