public function getModules() { if (isset(static::$modules)) { return static::$modules; } // $modules = $this->config->get('modules.modules', array()); $modules = array_map(function ($slug, $properties) { $autoload = array('config', 'events', 'filters', 'routes'); $options = array_get($properties, 'autoload', array()); if (!empty($options)) { $autoload = array_intersect($options, $autoload); } array_push($autoload, 'bootstrap'); // $namespace = isset($properties['namespace']) ? $properties['namespace'] : Str::studly($slug); return array_merge(array('slug' => $slug, 'name' => isset($properties['name']) ? $properties['name'] : $namespace, 'namespace' => $namespace, 'enabled' => isset($properties['enabled']) ? $properties['enabled'] : true, 'order' => isset($properties['order']) ? $properties['order'] : 9001, 'autoload' => $autoload), $properties); }, array_keys($modules), $modules); return static::$modules = Collection::make($modules)->sortBy('order'); }
/** * Get modules namespace. * * @return string */ public function getNamespace() { return rtrim($this->config->get('modules.namespace'), '/\\'); }