blob: 9f11ea3ae4e82b00983b30468e45cd6ca614b6d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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');
}
}
|