summaryrefslogtreecommitdiff
path: root/app/Article.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Article.php')
-rw-r--r--app/Article.php23
1 files changed, 23 insertions, 0 deletions
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 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Article extends Model
+{
+ protected $table = "view_article";
+
+ protected $fillable = [
+ ];
+
+ public function getDiscussions() {
+ #return $this->hasMany('App\Discussion', 'article_id', 'id');
+ return $this->hasMany('App\Discussion');
+ }
+
+ public function getCategories() {
+ return $this->belongsToMany('App\Category', 'article_category');
+ }
+}
+