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