- Added standard Laravel directory structure and configuration. - Included Svelte and Tailwind configuration for the admin interface. - Added core PHPUnit and testing scripts.
34 lines
954 B
PHP
34 lines
954 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin\Themes;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Admin\Themes\ViewThemesRequest;
|
|
use App\Services\ThemeService;
|
|
use App\Support\ThemeManager;
|
|
|
|
/**
|
|
* Controller for listing installed themes.
|
|
*/
|
|
class ThemeListController extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*
|
|
* @param \App\Http\Requests\Admin\Themes\ViewThemesRequest $request
|
|
* @param \App\Services\ThemeService $themeService
|
|
* @param \App\Support\ThemeManager $themeManager
|
|
* @return \Illuminate\View\View
|
|
*/
|
|
public function __invoke(ViewThemesRequest $request, ThemeService $themeService, ThemeManager $themeManager)
|
|
{
|
|
$themes = $themeService->list();
|
|
$activeTheme = $themeManager->getActiveTheme();
|
|
|
|
return view('admin.themes.index', [
|
|
'themes' => array_values($themes),
|
|
'activeTheme' => $activeTheme,
|
|
]);
|
|
}
|
|
}
|