Support the ongoing development of Laravel.io →
Configuration IOC Architecture
Last updated 1 year ago.
0

is this what you're looking for?

https://laravel.com/docs/5.3/helpers#paths

0

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.

0

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.
0

Thanks for your help, it works!

0

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.
0

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.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ttimot24 ttimot24 Joined 21 Oct 2016

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.