1 | <?php namespace Arcanedev\Taxonomies\Models; |
||
22 | class Category extends Model |
||
23 | { |
||
24 | /* ------------------------------------------------------------------------------------------------ |
||
25 | | Traits |
||
26 | | ------------------------------------------------------------------------------------------------ |
||
27 | */ |
||
28 | use NodeTrait; |
||
29 | |||
30 | /* ------------------------------------------------------------------------------------------------ |
||
31 | | Properties |
||
32 | | ------------------------------------------------------------------------------------------------ |
||
33 | */ |
||
34 | /** |
||
35 | * The attributes that aren't mass assignable. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $fillable = [ |
||
40 | 'name', 'slug', 'description', '_lft', '_rgt', 'parent_id', |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * Indicates if the model should be timestamped. |
||
45 | * |
||
46 | * @var bool |
||
47 | */ |
||
48 | public $timestamps = true; |
||
49 | |||
50 | /* ------------------------------------------------------------------------------------------------ |
||
51 | | Relationships |
||
52 | | ------------------------------------------------------------------------------------------------ |
||
53 | */ |
||
54 | /** |
||
55 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
56 | */ |
||
57 | public function categorizable() |
||
61 | |||
62 | /** |
||
63 | * @param string $related |
||
64 | * |
||
65 | * @return \Illuminate\Database\Eloquent\Relations\MorphToMany |
||
66 | */ |
||
67 | public function entries($related) |
||
75 | |||
76 | /* ------------------------------------------------------------------------------------------------ |
||
77 | | Other Functions |
||
78 | | ------------------------------------------------------------------------------------------------ |
||
79 | */ |
||
80 | 9 | public static function tree() |
|
84 | } |
||
85 |