1 | <?php |
||
11 | class Post extends Model |
||
12 | { |
||
13 | use PostScopes, |
||
14 | PostAttributes, |
||
15 | IsAuthorable, |
||
16 | PostsHaveComments; |
||
17 | |||
18 | const PUBLISHED = 'published'; |
||
19 | const DRAFT = 'draft'; |
||
20 | const SCHEDULED = 'scheduled'; |
||
21 | |||
22 | protected $table = 'posts'; |
||
23 | |||
24 | protected $primaryKey = 'id'; |
||
25 | |||
26 | public $guarded = []; |
||
27 | |||
28 | public $timestamps = true; |
||
29 | |||
30 | protected $appends = ['tagsCount']; |
||
31 | |||
32 | protected $dates = ['published_at']; |
||
33 | |||
34 | public function category() |
||
38 | |||
39 | public function comments() |
||
43 | |||
44 | public function tags() |
||
48 | } |
||
49 |