1 | <?php namespace jlourenco\blog\Models; |
||
8 | class BlogCategory extends Model |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * To allow user actions identity (Created_by, Updated_by, Deleted_by) |
||
13 | */ |
||
14 | use Creation; |
||
15 | |||
16 | use Sluggable; |
||
17 | |||
18 | use SoftDeletes; |
||
19 | |||
20 | /** |
||
21 | * {@inheritDoc} |
||
22 | */ |
||
23 | protected $table = 'BlogCategory'; |
||
24 | |||
25 | /** |
||
26 | * {@inheritDoc} |
||
27 | */ |
||
28 | protected $fillable = [ |
||
29 | 'name', |
||
30 | 'description', |
||
31 | 'slug' |
||
32 | ]; |
||
33 | |||
34 | protected $dates = [ 'created_at', 'deleted_at']; |
||
35 | |||
36 | /** |
||
37 | * The Blog post model name. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected static $postsModel = 'jlourenco\blog\Models\BlogPost'; |
||
42 | |||
43 | /** |
||
44 | * Returns the post model. |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public static function getPostsModel() |
||
52 | |||
53 | /** |
||
54 | * Sets the post model. |
||
55 | * |
||
56 | * @param string $postsModel |
||
57 | * @return void |
||
58 | */ |
||
59 | public static function setPostsModel($postsModel) |
||
63 | |||
64 | public function posts() |
||
68 | |||
69 | } |
||
70 |