diff options
author | Michael Weimann <mail@michael-weimann.eu> | 2019-10-31 20:02:34 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2019-11-10 22:10:11 +0100 |
commit | 6534191d59521e1e5a88638b1c6a1c77f74dd12a (patch) | |
tree | d381a16b7287c2ff3cff814a793ebc27bdeb4eac /src/Models/User/User.php | |
parent | 8b5b9e2c65193171a12bf99a8df860a66e6900a5 (diff) |
Migrate news to model class
Diffstat (limited to 'src/Models/User/User.php')
-rw-r--r-- | src/Models/User/User.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Models/User/User.php b/src/Models/User/User.php index af213c4e..cca96dbe 100644 --- a/src/Models/User/User.php +++ b/src/Models/User/User.php @@ -4,6 +4,8 @@ namespace Engelsystem\Models\User; use Carbon\Carbon; use Engelsystem\Models\BaseModel; +use Engelsystem\Models\News\News; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Query\Builder as QueryBuilder; @@ -95,4 +97,12 @@ class User extends BaseModel ->hasOne(State::class) ->withDefault(); } + + /** + * @return HasMany + */ + public function news(): HasMany + { + return $this->hasMany(News::class); + } } |