1 | <?php |
||
5 | trait SoftEnable |
||
6 | { |
||
7 | /** |
||
8 | * Boot the soft enabling trait for a model. |
||
9 | * |
||
10 | * @return void |
||
11 | */ |
||
12 | 7 | public static function bootSoftEnable() |
|
16 | |||
17 | /** |
||
18 | * Enable a soft-enabled model instance. |
||
19 | * |
||
20 | * @return bool|null |
||
21 | */ |
||
22 | 3 | public function enable() |
|
42 | |||
43 | /** |
||
44 | * Determine if the model instance is enabled. |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | 2 | public function isEnabled() |
|
52 | |||
53 | /** |
||
54 | * Register a enabling model event with the dispatcher. |
||
55 | * |
||
56 | * @param \Closure|string $callback |
||
57 | * @return void |
||
58 | */ |
||
59 | 2 | public static function enabling($callback) |
|
63 | |||
64 | /** |
||
65 | * Register a enabled model event with the dispatcher. |
||
66 | * |
||
67 | * @param \Closure|string $callback |
||
68 | * @return void |
||
69 | */ |
||
70 | 1 | public static function enabled($callback) |
|
74 | |||
75 | /** |
||
76 | * Disable a soft-enabled model instance. |
||
77 | * |
||
78 | * @return bool|null |
||
79 | */ |
||
80 | 29 | public function disable() |
|
100 | |||
101 | /** |
||
102 | * Determine if the model instance is disabled. |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | 2 | public function isDisabled() |
|
110 | |||
111 | /** |
||
112 | * Register a disabling model event with the dispatcher. |
||
113 | * |
||
114 | * @param \Closure|string $callback |
||
115 | * @return void |
||
116 | */ |
||
117 | 2 | public static function disabling($callback) |
|
121 | |||
122 | /** |
||
123 | * Register a disabled model event with the dispatcher. |
||
124 | * |
||
125 | * @param \Closure|string $callback |
||
126 | * @return void |
||
127 | */ |
||
128 | 1 | public static function disabled($callback) |
|
132 | |||
133 | /** |
||
134 | * Get the name of the "enabled" column. |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | 29 | public function getEnabledColumn() |
|
142 | |||
143 | /** |
||
144 | * Get the fully qualified "enabled" column. |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | 26 | public function getQualifiedEnabledColumn() |
|
152 | |||
153 | /** |
||
154 | * Get the casts array. |
||
155 | * |
||
156 | * @return array |
||
157 | */ |
||
158 | 29 | public function getCasts() |
|
164 | |||
165 | /** |
||
166 | * Get the observable event names. |
||
167 | * |
||
168 | * @return array |
||
169 | */ |
||
170 | 2 | public function getObservableEvents() |
|
179 | } |
||
180 |