Hi there!
I have tried this on a "normal" haveMany/belongsTo relationship, lets say Post has many Comment and it works fine, but when the relationship is a Morph relationship (using model_id and model_type fields), it doesnt seem to work... documentation doesnt say anything about touching timestamps in morph relationships. I solved that "manually" with model events but i dont know if iI'm missing something when trying to touch timestamps in a morph. how do you indicate the parent model?
protected $touches = ['model']
I've never used it in a Morph relationship, I don't think it would work, I also haven't seen it in the docs. So you were right to build it manually with Events.
Thanks! This concept has become more important to me when I have been indexing data using scout to rebuild the document
Hi there! I have tried this on a "normal" haveMany/belongsTo relationship, lets say Post has many Comment and it works fine, but when the relationship is a Morph relationship (using model_id and model_type fields), it doesnt seem to work... documentation doesnt say anything about touching timestamps in morph relationships. I solved that "manually" with model events but i dont know if iI'm missing something when trying to touch timestamps in a morph. how do you indicate the parent model? protected $touches = ['model']
I've never used it in a Morph relationship, I don't think it would work, I also haven't seen it in the docs. So you were right to build it manually with Events.