private function updateLanguageTerm($oldRoleName, $newRoleName)
    {
        $folder = resource_path("lang/*/role.php");
        foreach (glob($folder) as $langFile) {
            $langFileContent = require $langFile;
            if (!isset($langFileContent['roles'])) {
                $langFileContent['roles'] = [];
            }
            if (isset($langFileContent['roles'][$oldRoleName])) {
                $langFileContent['roles'][$newRoleName] = $langFileContent['roles'][$oldRoleName];
                unset($langFileContent['roles'][$oldRoleName]);
                $langContent = "<?php\n\nreturn " . Utils::exportArray($langFileContent) . ";\n";
                file_put_contents($langFile, $langContent);
            }
        }
    }
private function updateLanguageTerm($oldRoleName, $newRoleName)
    {
        $folder = resource_path("lang/*/role.php");
        foreach (glob($folder) as $langFile) {
            $langFileContent = require $langFile;
            if (!isset($langFileContent['roles'])) {
                $langFileContent['roles'] = [];
            }
            if (isset($langFileContent['roles'][$oldRoleName])) {
                $langFileContent['roles'][$newRoleName] = $langFileContent['roles'][$oldRoleName];
                unset($langFileContent['roles'][$oldRoleName]);
                $langContent = "<?php\n\nreturn " . Utils::exportArray($langFileContent) . ";\n";
                file_put_contents($langFile, $langContent);
            }
        }
    }
private function updateLanguageTerm ( $ oldRoleName , $ newRoleName ) { $ folder = resource_path ( "lang/*/role.php" ) ; foreach ( glob ( $ folder ) as $ langFile ) { $ langFileContent = require $ langFile ; if ( ! isset ( $ langFileContent [ 'roles' ] ) ) { $ langFileContent [ 'roles' ] = [ ] ; } if ( isset ( $ langFileContent [ 'roles' ] [ $ oldRoleName ] ) ) { $ langFileContent [ 'roles' ] [ $ newRoleName ] = $ langFileContent [ 'roles' ] [ $ oldRoleName ] ; unset ( $ langFileContent [ 'roles' ] [ $ oldRoleName ] ) ; $ langContent = "<?php\n\nreturn " . Utils :: exportArray ( $ langFileContent ) . ";\n" ; file_put_contents ( $ langFile , $ langContent ) ; } } }
To update language files in case of the role name is changed.
@param $oldRoleName
@param $newRoleName
To update language files in case of the role name is changed .