/** * Install modules from modules.json file. */ protected function installFromFile() { if (!file_exists($path = base_path('modules.json'))) { $this->error("File 'modules.json' does not exist in your project root."); return; } $modules = Json::make($path); $dependencies = $modules->get('require', []); foreach ($dependencies as $module) { $module = collect($module); $this->install($module->get('name'), $module->get('version'), $module->get('type')); } }
/** * Get theme info from json file. * * @param SplFileInfo $file * * @return array */ protected function getInfo($file) { $attributes = Json::make($path = $file->getRealPath())->toArray(); $attributes['path'] = dirname($path); return $attributes; }