1 | <?php namespace Arcanesoft\Blog\Models; |
||
12 | class Tag extends AbstractTaxonomy |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Constants |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | const SELECT_CACHE_NAME = 'blog::tags.select-data'; |
||
20 | |||
21 | /* ----------------------------------------------------------------- |
||
22 | | Properties |
||
23 | | ----------------------------------------------------------------- |
||
24 | */ |
||
25 | |||
26 | /** |
||
27 | * The database table used by the model |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $table = 'tags'; |
||
32 | |||
33 | /** |
||
34 | * The event map for the model. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $dispatchesEvents = [ |
||
39 | 'creating' => TagEvents\TagCreating::class, |
||
40 | 'created' => TagEvents\TagCreated::class, |
||
41 | 'updating' => TagEvents\TagUpdating::class, |
||
42 | 'updated' => TagEvents\TagUpdated::class, |
||
43 | 'saving' => TagEvents\TagSaving::class, |
||
44 | 'saved' => TagEvents\TagSaved::class, |
||
45 | 'deleting' => TagEvents\TagDeleting::class, |
||
46 | 'deleted' => TagEvents\TagDeleted::class, |
||
47 | 'restoring' => TagEvents\TagRestoring::class, |
||
48 | 'restored' => TagEvents\TagRestored::class, |
||
49 | ]; |
||
50 | |||
51 | /* ----------------------------------------------------------------- |
||
52 | | Relationships |
||
53 | | ----------------------------------------------------------------- |
||
54 | */ |
||
55 | |||
56 | /** |
||
57 | * Posts relationship. |
||
58 | * |
||
59 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
60 | */ |
||
61 | 2 | public function posts() |
|
65 | |||
66 | /* ----------------------------------------------------------------- |
||
67 | | Main Methods |
||
68 | | ----------------------------------------------------------------- |
||
69 | */ |
||
70 | |||
71 | /** |
||
72 | * Get the categories options for select input. |
||
73 | * |
||
74 | * @return \Illuminate\Support\Collection |
||
75 | */ |
||
76 | 2 | public static function getSelectData() |
|
93 | } |
||
94 |