is this what you're looking for?
No, I would like to themeing my app. The themes are in the [root]/themes/. Each theme needs their own lang files. So when I rendering a view from the theme, trans() should have theme langs loaded instead the default lang path.
in your appServiceProvider call loadTranslationsFrom method like this
public function boot()
{
$this->loadTranslationsFrom(app_path('/themes/themename/lang')), null);
}
you could pass a namespace after the path if you want, instead of null
$this->loadTranslationsFrom(app_path('/themes/themename/lang')), 'coolTheme');
use it like this
trans('header.title'); // without namespace
trans('coolTheme::header.title'); // with namespace
hi I am new in laravel for last 1 week. I have an assignment to develop an web application in which user select theme which he/she like. I have two different theme in laravel application now i want to switch one theme to another theme during runtime. I waste two days for this small task and i tried lot of thing like laravel/igastertheme package and follow it step by step but could not found success and i do not find any video link or tutorial to managing multiple theme in an application. I see your(ttimot24) thread i hope you done same kind of solution. I request please made a video how to add multiple themes and switch between these theme during runtime its help me and beginner like me. i am very grateful to you.
You just have to define a row in db for theme, and build the theme path/namespace by that value dynamically.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community