- Added standard Laravel directory structure and configuration. - Included Svelte and Tailwind configuration for the admin interface. - Added core PHPUnit and testing scripts.
32 lines
892 B
PHP
32 lines
892 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin\Themes;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Admin\Themes\AccessThemeEditorRequest;
|
|
use App\Support\ThemeManager;
|
|
|
|
/**
|
|
* Controller for displaying the theme editor UI.
|
|
*/
|
|
class ThemeEditorIndexController extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*
|
|
* @param \App\Http\Requests\Admin\Themes\AccessThemeEditorRequest $request
|
|
* @param \App\Support\ThemeManager $themeManager
|
|
* @return \Illuminate\View\View
|
|
*/
|
|
public function __invoke(AccessThemeEditorRequest $request, ThemeManager $themeManager)
|
|
{
|
|
$themes = array_values($themeManager->getThemes());
|
|
$activeThemeSlug = $themeManager->getActiveTheme();
|
|
|
|
return view('admin.themes.editor', [
|
|
'themes' => $themes,
|
|
'activeThemeSlug' => $activeThemeSlug,
|
|
]);
|
|
}
|
|
}
|