How to switch themes in the admin? #618
Replies: 2 comments
-
Hey @SequelONE, you can see how it's working in the demo repo.
Route::post('switch-layout', function (Request $request) {
$theme = 'backpack.theme-'.$request->get('theme', 'tabler').'::';
Session::put('backpack.ui.view_namespace', $theme);
if ($theme === 'backpack.theme-tabler::') {
Session::put('backpack.theme-tabler.layout', $request->get('layout', 'horizontal'));
}
return Redirect::back();
})->name('tabler.switch.layout'); |
Beta Was this translation helpful? Give feedback.
0 replies
-
@karandatwani92 thank you. Tried your method. For some reason, themes after the selection do not change. As if the session is recorded at the beginning, and after the redirect is reset. What can be done? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there some PHP function to switch themes in the admin? For example, Laravel has a locale entry
App::setLocale('en')
.Beta Was this translation helpful? Give feedback.
All reactions