🔥 Laravel tip: update the parent model timestamp when a child is updated
Mar 13, 2022
Did you know you can update the parent model timestamp when a child is updated?
If you have a "belongsTo" or "belongsToMany" relationship you can define a "$touches" property to do this.
If you have a "belongsTo" or "belongsToMany" relationship you can define a "$touches" property to do this.
![tip-image-0](https://res.cloudinary.com/dpmeu3otn/image/upload/v1666548866/tips/s3r8ocyx8k6qj0mfsnjf.jpg)
Other tips:
🔥 Laravel tip: Job Encryption
Mar 17, 2022