Nwidart\Modules\Json::make PHP Method

make() public static method

Make new instance.
public static make ( string $path, Illuminate\Filesystem\Filesystem $filesystem = null ) : static
$path string
$filesystem Illuminate\Filesystem\Filesystem
return static
    public static function make($path, Filesystem $filesystem = null)
    {
        return new static($path, $filesystem);
    }

Usage Example

 /**
  * 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'));
     }
 }
All Usage Examples Of Nwidart\Modules\Json::make