1 | <?php |
||
12 | class Post extends Model |
||
13 | { |
||
14 | use PostScopes, |
||
15 | PostAttributes, |
||
16 | IsAuthorable, |
||
17 | PostsHaveComments, |
||
18 | PostsHaveACategory; |
||
19 | |||
20 | const PUBLISHED = 'published'; |
||
21 | const DRAFT = 'draft'; |
||
22 | const SCHEDULED = 'scheduled'; |
||
23 | |||
24 | protected $table = 'posts'; |
||
25 | |||
26 | protected $primaryKey = 'id'; |
||
27 | |||
28 | public $guarded = []; |
||
29 | |||
30 | public $timestamps = true; |
||
31 | |||
32 | protected $appends = ['tagsCount']; |
||
33 | |||
34 | protected $dates = ['published_at']; |
||
35 | |||
36 | public function category() |
||
40 | |||
41 | public function comments() |
||
54 | |||
55 | public function approvedComments() |
||
59 | |||
60 | public function disapprovedComments() |
||
64 | |||
65 | public function guestComments() |
||
69 | |||
70 | public function userComments() |
||
74 | |||
75 | public function tags() |
||
79 | |||
80 | public function path() |
||
84 | } |
||
85 |