Update parent "updated_at"

How can I update parent "updated_at", if I modify repeters relationships field?
5 Replies
toeknee
toeknee2y ago
How are you updating the relationship? updated_at should be part of the model and any change to the model will update it accordingly?
AlexAnder
AlexAnderOP2y ago
In main model Survey I have relationship answers, answers are edited in SurveyResource repeater->relationships. Edited field belongs to answer, but I want that, Survey updated_at also changes
toeknee
toeknee2y ago
Ok, but if nothing has changed in the parent that's not easily updatable, you would need to adjust it to handle a manual update as part of the action
AlexAnder
AlexAnderOP2y ago
Ok, tHanks. Completely forrgotten about Laravel model
protected $touches = ['survey'];
protected $touches = ['survey'];
toeknee
toeknee2y ago
Perfectly done
Want results from more Discord servers?
Add your server