<commit_before><?php

namespace Lucid\Modular;

class ModulesServiceProvider extends  \Illuminate\Support\ServiceProvider
{
    public function boot()
    {
        $this->publishes([ 
            __DIR__.'/modules.php' => config_path('modules.php'),
            __DIR__.'/migrations') => $this->app->databasePath().'/migrations'
            ]);
        
        $modules = config('modules._modules',[]);
        $path = config('modules.path');

        foreach ($modules as $module) {
            if(file_exists($path.$module.'/boot.php')) {
                include $path.$module.'/boot.php';
            }
            if(is_dir($path.$module.'/views')) {
                $this->loadViewsFrom($path.$module.'/views', $module);
            }
            if(file_exists($path.$module.'/config.php')) {
                $this->mergeConfigFrom($path.$module.'/config.php', $module);
            }
            if(is_dir($path.$module.'/lang')) {
                $this->loadTranslationsFrom($path.$module.'/lang', $module);
            }
        }

        //Route for module assets
        \Route::get('modules/{moduleName}/{path}',function($moduleName,$path){
            return ModulesManager::getAsset($moduleName,$path);
        })->where('path', '(.*)');
    }

    public function register(){
        $this->mergeConfigFrom(__DIR__.'/modules.php', 'modules'); 

        $this->app->singleton(ModulesManager::class, function ($app) {
            return new ModulesManager();
        });

        $this->commands([
            'Panel\Modules\commands\migrate',
            'Panel\Modules\commands\test'
        ]);
    }
}
<commit_msg>Update ModulesServiceProvider.php<commit_after><?php

namespace Lucid\Modular;

class ModulesServiceProvider extends  \Illuminate\Support\ServiceProvider
{
    public function boot()
    {
        $this->publishes([ 
            __DIR__.'/modules.php' => config_path('modules.php'),
            __DIR__.'/migrations') => database_path('/migrations')
            ]);
        
        $modules = config('modules._modules',[]);
        $path = config('modules.path');

        foreach ($modules as $module) {
            if(file_exists($path.$module.'/boot.php')) {
                include $path.$module.'/boot.php';
            }
            if(is_dir($path.$module.'/views')) {
                $this->loadViewsFrom($path.$module.'/views', $module);
            }
            if(file_exists($path.$module.'/config.php')) {
                $this->mergeConfigFrom($path.$module.'/config.php', $module);
            }
            if(is_dir($path.$module.'/lang')) {
                $this->loadTranslationsFrom($path.$module.'/lang', $module);
            }
        }

        //Route for module assets
        \Route::get('modules/{moduleName}/{path}',function($moduleName,$path){
            return ModulesManager::getAsset($moduleName,$path);
        })->where('path', '(.*)');
    }

    public function register(){
        $this->mergeConfigFrom(__DIR__.'/modules.php', 'modules'); 

        $this->app->singleton(ModulesManager::class, function ($app) {
            return new ModulesManager();
        });

        $this->commands([
            'Lucid\Modular\commands\migrate',
            'Lucid\Modular\commands\test'
        ]);
    }
}

{'fraction_non_alphanumeric': 0.1755189255189255, 'fraction_numerical': 0.0, 'mean_word_length': 2.0569029850746268, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '496468', 'n_tokens_mistral': 927, 'n_tokens_neox': 917, 'n_words': 115}