Hi,
nice package!
I'm not so experienced in Laravel, however, in order to hot-switch themes, I tried to change the "set" function in Themes class as follows:
// Set active theme (by name)
public function set($themeName){
$theme = $this->find($themeName);
$this->activeTheme = $theme;
$paths = [];
do {
$paths[] = $this->defaultViewsPath.'/'.$theme->viewsPath;
} while ($theme = $theme->getParent());
Config::set('view.paths', $paths);
App::rebinding('view.finder', function($app)
{
$paths = $app['config']['view.paths'];
return new FileViewFinder($app['files'], $paths);
});
View::setFinder(app('view.finder'));
}
I don't know if it is a good idea to call App::rebinding outside of a service provider but it seems to work for now. Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community