Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using in Service Prodiver #67

Closed
DuelistRag3 opened this issue May 20, 2023 · 2 comments
Closed

Using in Service Prodiver #67

DuelistRag3 opened this issue May 20, 2023 · 2 comments

Comments

@DuelistRag3
Copy link

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

@DuelistRag3
Copy link
Author

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
Copy link
Owner

Shipu commented Aug 7, 2023

Fixed in v3.0.4 version.

@Shipu Shipu closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants