diff options
| author | horus | 2020-04-02 21:52:04 +0200 |
|---|---|---|
| committer | horus | 2020-04-02 21:52:04 +0200 |
| commit | 5a8c47e29afdbb61c32c1e03162abb1bb871ee9e (patch) | |
| tree | 19cd2e0c48119a703306a71df813d07666289e8f /app/Article.php | |
| download | curious-5a8c47e29afdbb61c32c1e03162abb1bb871ee9e.tar.gz | |
Initial commit.
Diffstat (limited to 'app/Article.php')
| -rw-r--r-- | app/Article.php | 23 |
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'); + } +} + |
