Shipu/themevel

Using in Service Prodiver

DuelistRag3 opened this issue · 2 comments

When using Theme::current() in service provider it returns an empty string. I try to use themevel together with nwidart modules package and for the modules to find the views it is necessary to add the current theme path into the Modules service provider like this:

public function registerViews()
    {
        $themePath = base_path('Themes/'.Theme::current().'/views/modules/'. $this->moduleNameLower);

        $viewPath = resource_path('views/modules/' . $this->moduleNameLower);

        $sourcePath = module_path($this->moduleName, 'Resources/views');

        echo($themePath);

        $this->publishes([
            $sourcePath => $viewPath
        ], ['views', $this->moduleNameLower . '-module-views']);

        $this->loadViewsFrom(array_merge([$themePath], $this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
    }

but $themePath return:
/var/www/html/Themes//views/modules/installer

Okay so, that was because no theme was set, but i included the facade and set the active theme in the config, but no theme is active

Shipu commented

Fixed in v3.0.4 version.