| @@ 177-188 (lines=12) @@ | ||
| 174 | * |
|
| 175 | * @return Collection |
|
| 176 | */ |
|
| 177 | public function enabled() |
|
| 178 | { |
|
| 179 | $moduleCache = $this->getCache(); |
|
| 180 | ||
| 181 | $modules = $this->all()->map(function($item, $key) use ($moduleCache) { |
|
| 182 | $item['enabled'] = $moduleCache->get($item['slug']); |
|
| 183 | ||
| 184 | return $item; |
|
| 185 | }); |
|
| 186 | ||
| 187 | return $modules->where('enabled', true); |
|
| 188 | } |
|
| 189 | ||
| 190 | /** |
|
| 191 | * Get all disabled modules. |
|
| @@ 195-206 (lines=12) @@ | ||
| 192 | * |
|
| 193 | * @return Collection |
|
| 194 | */ |
|
| 195 | public function disabled() |
|
| 196 | { |
|
| 197 | $moduleCache = $this->getCache(); |
|
| 198 | ||
| 199 | $modules = $this->all()->map(function($item, $key) use ($moduleCache) { |
|
| 200 | $item['enabled'] = $moduleCache->get($item['slug']); |
|
| 201 | ||
| 202 | return $item; |
|
| 203 | }); |
|
| 204 | ||
| 205 | return $modules->where('enabled', false); |
|
| 206 | } |
|
| 207 | ||
| 208 | /** |
|
| 209 | * Check if specified module is enabled. |
|