src/Classes/Module.php
public static function getModulesFromDisk()
    {
        // check Modules folder is created or not
        if (!app('files')->exists(app_path('Modules')))
            app('files')->makeDirectory(app_path('Modules'));
        $authors = app('files')->directories(app_path('Modules'));
        $results = [];
        if ($authors && count($authors))
        {
            foreach ($authors as $author)
            {
                $authorName = basename($author);
                $modules = app('files')->directories($author);
                if ($modules && count($modules))
                {
                    foreach ($modules as $module)
                    {
                        // check module yaml
                        $ymlPath = $module . '/module.yml';
                        if (app('files')->exists($ymlPath))
                        {
                            $detail = Yaml::parse(app('files')->get($ymlPath));
                            $results[$authorName][] = $detail;
                        }
                    }
                }
            }
        }
        return $results;
    }
public static function getModulesFromDisk()
    {
        // check Modules folder is created or not
        if (!app('files')->exists(app_path('Modules')))
            app('files')->makeDirectory(app_path('Modules'));
        $authors = app('files')->directories(app_path('Modules'));
        $results = [];
        if ($authors && count($authors))
        {
            foreach ($authors as $author)
            {
                $authorName = basename($author);
                $modules = app('files')->directories($author);
                if ($modules && count($modules))
                {
                    foreach ($modules as $module)
                    {
                        // check module yaml
                        $ymlPath = $module . '/module.yml';
                        if (app('files')->exists($ymlPath))
                        {
                            $detail = Yaml::parse(app('files')->get($ymlPath));
                            $results[$authorName][] = $detail;
                        }
                    }
                }
            }
        }
        return $results;
    }
public static function getModulesFromDisk ( ) { // check Modules folder is created or not if ( ! app ( 'files' ) -> exists ( app_path ( 'Modules' ) ) ) app ( 'files' ) -> makeDirectory ( app_path ( 'Modules' ) ) ; $ authors = app ( 'files' ) -> directories ( app_path ( 'Modules' ) ) ; $ results = [ ] ; if ( $ authors && count ( $ authors ) ) { foreach ( $ authors as $ author ) { $ authorName = basename ( $ author ) ; $ modules = app ( 'files' ) -> directories ( $ author ) ; if ( $ modules && count ( $ modules ) ) { foreach ( $ modules as $ module ) { // check module yaml $ ymlPath = $ module . '/module.yml' ; if ( app ( 'files' ) -> exists ( $ ymlPath ) ) { $ detail = Yaml :: parse ( app ( 'files' ) -> get ( $ ymlPath ) ) ; $ results [ $ authorName ] [ ] = $ detail ; } } } } } return $ results ; }
get from disk
get from disk