Loheide-eu-mitarbeiterplatt.../app/Http/Controllers/EditorialController.php
Friederich Loheide d5b7b1e0a8
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m51s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m48s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m30s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m49s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m37s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Redaktion mit Bereichsleiste und Übersicht (0.42.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 18:38:44 +00:00

28 lines
855 B
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\Editorial\Editorial;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class EditorialController extends Controller
{
public function __invoke(Request $request, Editorial $editorial): Response
{
$user = $request->user();
abort_unless($editorial->visibleFor($user), 403);
// /redaktion?bereich=news – ein Bereich in voller Breite; ohne Angabe die Übersicht
$key = (string) $request->query('bereich', '');
$section = $key !== '' ? $editorial->section($key, $user) : null;
abort_if($key !== '' && $section === null, 404);
return Inertia::render('Editorial/Index', [
'areas' => $editorial->menu($user),
'active' => $section['key'] ?? null,
'section' => $section,
]);
}
}