Common/GeneratorConfig.php
/**
     * Change the paths and namespaces definitions for generator to the specific target module
     *
     * @param $moduleName
     */
Change the paths and namespaces definitions for generator to the specific target module
@param $moduleName
Change the paths and namespaces definitions for generator to the specific target module @param $moduleName
public function changeConfig($moduleName)
    {
        $config = app('config');
        $modulePaths = $config->get('modules.generator.path');
        $moduleNamespaces = $config->get('modules.generator.namespace');
        $addOn = $config->get('modules.generator.add_on');
        $templates = $config->get('modules.generator.templates');
        $templatesDir = $config->get('modules.generator.path.templates_dir');
        array_walk($modulePaths, function (&$item, $key, $module) {
            $item = str_replace('{Module}', $module, $item);
        }, $moduleName);
        array_walk($moduleNamespaces, function (&$item, $key, $module) {
            $item = str_replace('{Module}', $module, $item);
        }, $moduleName);
        $config->set('infyom.laravel_generator.path', $modulePaths);
        $config->set('infyom.laravel_generator.namespace', $moduleNamespaces);
        $config->set('infyom.laravel_generator.add_on', $addOn);
        $config->set('infyom.laravel_generator.templates', $templates);
        $config->set('infyom.laravel_generator.path.templates_dir', $templatesDir);
    }
public function changeConfig ( $ moduleName ) { $ config = app ( 'config' ) ; $ modulePaths = $ config -> get ( 'modules.generator.path' ) ; $ moduleNamespaces = $ config -> get ( 'modules.generator.namespace' ) ; $ addOn = $ config -> get ( 'modules.generator.add_on' ) ; $ templates = $ config -> get ( 'modules.generator.templates' ) ; $ templatesDir = $ config -> get ( 'modules.generator.path.templates_dir' ) ; array_walk ( $ modulePaths , function ( & $ item , $ key , $ module ) { $ item = str_replace ( '{Module}' , $ module , $ item ) ; } , $ moduleName ) ; array_walk ( $ moduleNamespaces , function ( & $ item , $ key , $ module ) { $ item = str_replace ( '{Module}' , $ module , $ item ) ; } , $ moduleName ) ; $ config -> set ( 'infyom.laravel_generator.path' , $ modulePaths ) ; $ config -> set ( 'infyom.laravel_generator.namespace' , $ moduleNamespaces ) ; $ config -> set ( 'infyom.laravel_generator.add_on' , $ addOn ) ; $ config -> set ( 'infyom.laravel_generator.templates' , $ templates ) ; $ config -> set ( 'infyom.laravel_generator.path.templates_dir' , $ templatesDir ) ; }
Change the paths and namespaces definitions for generator to the specific target module
 @param $moduleName
Change the paths and namespaces definitions for generator to the specific target module @param $moduleName
// Getting paths patterns // Getting namespaces patterns // Getting add_on definition from generator // Getting template definition from generator // Getting template dir definition from generator // Replacing paths // Replacing namespaces // Overriding paths // Overriding namespaces // Override add_on definition // Override templates definition // Override templates dir definition