phpvms/app/Http/Middleware/SetActiveTheme.php
Nabeel S ec4f10d43a
359 Select theme in settings (#423)
* Update composer package versions

* Laravel version

* Change theme in the admin settings page closes #359

* Fix comment
2019-10-30 09:05:18 -04:00

23 lines
409 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
use Igaster\LaravelTheme\Facades\Theme;
/**
* Read the current theme from the settings (set in admin), and set it
*/
class SetActiveTheme
{
public function handle($request, Closure $next)
{
$theme = setting('general.theme');
if (!empty($theme)) {
Theme::set($theme);
}
return $next($request);
}
}