I have a similar example to that in the docs.. a comment and post scenario.
I want notifications when comments are added, but I want the post to handle the notifications for it and its children.
If I have the comment touch the post by setting it in the 'touches' model variable, can I get the new comment with a call like this? :
$new_comment = $post->comments()->where('created_at', $post->updated_at)->first();
I imagine it will almost always have the same timestamp, but how could I do this in a way that will always match?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community