From 5a8c47e29afdbb61c32c1e03162abb1bb871ee9e Mon Sep 17 00:00:00 2001 From: horus Date: Thu, 2 Apr 2020 21:52:04 +0200 Subject: Initial commit. --- app/Article.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/Article.php (limited to 'app/Article.php') diff --git a/app/Article.php b/app/Article.php new file mode 100644 index 0000000..9f11ea3 --- /dev/null +++ b/app/Article.php @@ -0,0 +1,23 @@ +hasMany('App\Discussion', 'article_id', 'id'); + return $this->hasMany('App\Discussion'); + } + + public function getCategories() { + return $this->belongsToMany('App\Category', 'article_category'); + } +} + -- cgit v1.2.3