Loheide-eu-mitarbeiterplatt.../app/Http/Controllers/HomepageEditorController.php
Friederich Loheide 8eb5d4a475
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 10m3s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 9m26s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 10m59s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m24s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m26s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m26s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 49s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m6s
Globale Fußzeile mit Baukasten (0.38.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 15:59:26 +00:00

56 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Http\Controllers;
use App\Dashboard\Homepage;
use Illuminate\Http\Request;
/**
* Frei gestaltete Startseite bearbeiten (erreichbar aus dem Backend unter „Startseite“).
*/
class HomepageEditorController extends BuilderDocumentController
{
public function __construct(private readonly Homepage $homepage) {}
protected function document(): Homepage
{
return $this->homepage;
}
protected function config(): array
{
return [
'kind' => 'homepage',
'base' => '/startseite/gestalten',
'title' => 'Startseite gestalten',
'back' => '/admin/startseite',
'preview' => '/?entwurf=1',
'media_label' => 'Auf der Startseite',
'empty' => 'Leere Startseite – rechts Blöcke wählen, z. B. „Spalten“ und darin „Neuigkeiten“ oder „Kachel“.',
'hint' => 'Unter „Startseite“ stehen alle Kacheln als Block bereit. Jeder Block lässt sich über „Sichtbarkeit“ auf Rollen, Abteilungen oder Standorte beschränken.',
'initial' => 'Noch nicht veröffentlicht – Ausgangspunkt ist die heutige Startseite',
];
}
protected function context(): array
{
return ['homepage' => true];
}
protected function mediaFolder(): string
{
return 'pagebuilder/startseite';
}
protected function published(Request $request): void
{
if ($request->boolean('activate')) {
$this->homepage->setMode('builder');
}
}
protected function state(): array
{
return [...parent::state(), 'mode' => $this->homepage->mode()];
}
}