Support the ongoing development of Laravel.io →
Installation Packages
Last updated 2 years ago.
0

pretty easy, cant give all the code because it a lot, basically this is what needs to be done.

you need a ThemeServiceProvider class that loads view, lang, asset files for the current theme, basically this will search for the files in a specified directory and load them. use the methods mergeConfigFrom, loadViewsFrom, loadTranslationsFrom, in the ServiceProvider class to load files from a specific folder. refer to https://github.com/laravel/framework/blob/5.2/src/Illuminate/Support/ServiceProvider.php

These methods support input paths as arrays, the first array element will be your theme directory while the seconds should be your fallback theme directory, in your service provider you call it like this. so the current theme will always override the base theme

$this->loadViewsFrom([$currentThemeViewsPath, $defaultViewsPath], $someNamespace);

i hope it helps.

here's a sample from something i'm working on https://github.com/codebreez/collejo-core/blob/master/Providers/Module/ModuleServiceProvider.php#L14

Last updated 8 years ago.
0

Thanks you @astroanu

I will look through it and will let you later. :)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

ohid ohid Joined 23 Mar 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.