Files
Atomcms-edit/app/Http/Middleware/SetThemeMiddleware.php
T
root 043854cf3d Modernize: remove unused deps, replace qirolab/laravel-themer with custom ThemeService, drop doctrine/dbal
- Remove whichbrowser/parser, mockery/mockery, fruitcake/laravel-debugbar,
  itsgoingd/clockwork (all unused)
- Replace qirolab/laravel-themer (dev-master) with custom App\Services\ThemeService
  and App\Providers\ThemeServiceProvider
- Drop doctrine/dbal: rewrite all ->change() calls in 8 migrations to raw
  DB::statement('ALTER TABLE ... MODIFY ...') SQL
- RenameColumn() kept intact (works without dbal in Laravel 13)
- Fix 2026_04_04 migration: inverted column-exists logic corrected
- Clear bootstrap cache to remove stale references to removed packages
2026-06-20 15:25:49 +02:00

29 lines
602 B
PHP
Executable File

<?php
namespace App\Http\Middleware;
use App\Services\ThemeService;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class SetThemeMiddleware
{
public function __construct(
private readonly ThemeService $themeService,
) {}
public function handle(Request $request, Closure $next): Response
{
$theme = setting('theme');
if (empty($theme) || $theme === '1') {
$this->themeService->set('atom');
} else {
$this->themeService->set($theme);
}
return $next($request);
}
}