Dynamically load Custom Theme

Dynamically load Custom Theme

Laraship QuestionsCategory: Theme CustomizationDynamically load Custom Theme
Eran Levi asked 3 weeks ago
Hello
I have written a new custom theme (in VueJS) and it work great, the thing is, I want to use this theme only in my custom module I have written, and not in all pages, so the theme should be loaded in specific URLs or per module, it sounds like an easy task but I guess you can provide me the right way of doing it.
How can I switch the themes dynamically per URL\Module?
 
Thank you
1 Answers
laraship Staff answered 3 weeks ago
Hello Evan,
You can add the following function under your controller and add your logic to decide with theme to load
 

public function setTheme()
{
\Theme::set('your-theme-name');
}
Eran Levi
replied 3 weeks ago

Thank you, Ill try it now.

BLACK FRIDAY

60% DISCOUNT ON OUR ENTIRE STORE
COUPON CODE : BLACK2020
GO TO STORE
LIMITED TIME OFFER
close-link
60% Off on all of LARASHIP platforms, plugins, and themes NO EXCLUSIONS
CODE: BLACK2020
close-image