From a81ede8b98b503cb31ca2f872cc83fbc349685a8 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sun, 16 Oct 2016 23:36:39 +0100 Subject: [PATCH] Comments relationship for users --- src/Models/User.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Models/User.php b/src/Models/User.php index 1ff21ae..6c59513 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -50,4 +50,14 @@ class User extends Model implements AuthenticatableContract { return get_author_posts_url($this->ID, $this->display_name); } + + /** + * Get all the comments that belong to this user. + * + * @return HasMany + */ + public function comments() + { + return $this->hasMany(Comment::class); + } } -- libgit2 1.7.2