diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-11-20 00:00:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 00:00:57 +0100 |
commit | aa91ab4cf7219268bbddcd2f3a12bc5c1c5da96f (patch) | |
tree | 23b2f1f0c5293902be0f2734beb0845102f76837 /src/Models/User/User.php | |
parent | d83d60ce8d986e4e7cf28680189b5ef43b780e10 (diff) | |
parent | 17192a2c412a6f5c4d8c10d8d25ef1a680bbce01 (diff) |
Merge pull request #675 from weeman1337/feature-news-comments-migration
Introduce the NewsComments model
Diffstat (limited to 'src/Models/User/User.php')
-rw-r--r-- | src/Models/User/User.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Models/User/User.php b/src/Models/User/User.php index 058f9a8c..6db4de7e 100644 --- a/src/Models/User/User.php +++ b/src/Models/User/User.php @@ -5,6 +5,8 @@ namespace Engelsystem\Models\User; use Carbon\Carbon; use Engelsystem\Models\BaseModel; use Engelsystem\Models\News; +use Engelsystem\Models\NewsComment; +use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Query\Builder as QueryBuilder; @@ -23,6 +25,7 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * @property-read QueryBuilder|PersonalData $personalData * @property-read QueryBuilder|Settings $settings * @property-read QueryBuilder|State $state + * @property-read Collection|NewsComment[] $newsComments * * @method static QueryBuilder|User whereId($value) * @method static QueryBuilder|User[] whereName($value) @@ -105,4 +108,12 @@ class User extends BaseModel { return $this->hasMany(News::class); } + + /** + * @return HasMany + */ + public function newsComments(): HasMany + { + return $this->hasMany(NewsComment::class); + } } |