Support the ongoing development of →
Configuration IOC Architecture
Last updated 2 years ago.

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
Last updated 7 years ago.

Thanks for your help, it works!


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.

Last updated 7 years ago.

You just have to define a row in db for theme, and build the theme path/namespace by that value dynamically.

Last updated 7 years ago.

Sign in to participate in this thread!


Your banner here too?

ttimot24 ttimot24 Joined 21 Oct 2016


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.