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
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
28 lines
855 B
PHP
28 lines
855 B
PHP
<?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,
|
||
]);
|
||
}
|
||
}
|