Shipu / themevel

Theme and asset management for laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set theme from controllers

gotexx1 opened this issue · comments

I can't set theme from my controller like this:

public function switchTheme(Request $request)
{
    $request->validate([
        'theme' => ['required', 'string']
    ]);

     Theme::set($request->theme);

     return redirect()->route('admin.settings.index', ['p' => 'theme'])
        ->with('toast', 'success')
        ->with('message', 'Thème ' . Theme::current() . ' appliqué avec succès');
}

Theme::current() value still the Default active Theme in config/theme.php