359 Select theme in settings (#423)
* Update composer package versions * Laravel version * Change theme in the admin settings page closes #359 * Fix comment
This commit is contained in:
22
app/Http/Middleware/SetActiveTheme.php
Normal file
22
app/Http/Middleware/SetActiveTheme.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user