Loheide-eu-mitarbeiterplatt.../routes/web.php
Friederich Loheide b3e2b525e1
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m10s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 6m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m33s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m25s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m28s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m27s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m26s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m27s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m12s
Herzen, Reichweite und App-Anbindung (0.30.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 12:24:11 +00:00

132 lines
8.9 KiB
PHP
Raw Permalink 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
use App\Http\Controllers\Admin\UpdateController;
use App\Http\Controllers\AppConnectController;
use App\Http\Controllers\AppearanceController;
use App\Http\Controllers\Auth\IdentityLoginController;
use App\Http\Controllers\CronController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\EditorialController;
use App\Http\Controllers\HomepageEditorController;
use App\Http\Controllers\ImpersonationController;
use App\Http\Controllers\InstallController;
use App\Http\Controllers\MediaController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\OrganigramController;
use App\Http\Controllers\PeopleController;
use App\Http\Controllers\PluginAssetController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\PushController;
use App\Http\Controllers\SearchController;
use Illuminate\Support\Facades\Route;
// Web-Installer – nur solange die Installation nicht eingerichtet ist.
Route::prefix('install')->middleware('throttle:30,1')->group(function () {
Route::get('/', [InstallController::class, 'requirements']);
Route::get('/datenbank', [InstallController::class, 'database']);
Route::post('/datenbank', [InstallController::class, 'saveDatabase']);
Route::get('/konto', [InstallController::class, 'account']);
Route::post('/konto', [InstallController::class, 'saveAccount']);
});
// Web-App-Manifest (Name, Symbole, Farbe aus dem Erscheinungsbild)
Route::get('/manifest.webmanifest', [AppearanceController::class, 'manifest'])->name('manifest');
// Vorschau für „Erscheinungsbild“
Route::middleware(['auth', 'can:appearance.manage'])->group(function () {
Route::get('/erscheinungsbild/vorschau/anmeldung', [AppearanceController::class, 'loginPreview'])->name('appearance.preview.login');
Route::get('/erscheinungsbild/vorschau/beispiel', [AppearanceController::class, 'sample'])->name('appearance.preview.sample');
});
// Web-Cron für Hoster ohne Cron (siehe App\Support\BackgroundTasks).
Route::get('/cron/{token}', CronController::class)->middleware('throttle:10,1')->name('cron');
// Anmeldung über Identity Provider (Entra ID, OpenID Connect, LDAP, SAML …).
// Die Rückkehr darf per POST kommen (SAML) und ist dafür vom CSRF-Schutz ausgenommen –
// geschützt wird sie über Signatur und Anfrage-Kennung (bootstrap/app.php).
Route::middleware(['guest', 'throttle:30,1'])->group(function () {
Route::get('/auth/{provider:slug}/redirect', [IdentityLoginController::class, 'redirect'])->name('identity.redirect');
Route::match(['get', 'post'], '/auth/{provider:slug}/callback', [IdentityLoginController::class, 'callback'])->name('identity.callback');
Route::post('/auth/{provider:slug}/login', [IdentityLoginController::class, 'login'])->name('identity.login');
});
Route::get('/auth/{provider:slug}/metadata', [IdentityLoginController::class, 'metadata'])->middleware('throttle:30,1')->name('identity.metadata');
// Login, Logout und Passwort-Reset stellt Laravel Fortify bereit (FortifyServiceProvider).
Route::middleware('auth')->group(function () {
Route::get('/', DashboardController::class)->name('dashboard');
// Inhaus-App über den Browser verbinden (docs/API.md)
Route::get('/app/verbinden', [AppConnectController::class, 'show'])->name('app.connect');
Route::post('/app/verbinden', [AppConnectController::class, 'confirm'])->middleware('throttle:20,1')->name('app.connect.confirm');
Route::get('/redaktion', EditorialController::class)->name('editorial');
// Mediathek und Bildauswahl der Editoren
Route::prefix('redaktion/mediathek')->name('media.')->middleware('can:media.use')->controller(MediaController::class)->group(function () {
Route::get('/', 'index')->name('index');
Route::get('/liste', 'list')->name('list');
Route::post('/', 'store')->name('store')->middleware('throttle:120,1');
Route::post('/loeschen', 'bulkDestroy')->name('bulk-destroy');
Route::post('/neu-einlesen', 'rebuild')->name('rebuild')->middleware('throttle:5,1');
Route::get('/{media}', 'show')->name('show')->whereNumber('media');
Route::put('/{media}', 'update')->name('update')->whereNumber('media');
Route::post('/{media}/ersetzen', 'replace')->name('replace')->whereNumber('media');
Route::delete('/{media}', 'destroy')->name('destroy')->whereNumber('media');
Route::get('/{media}/original', 'download')->name('download')->whereNumber('media');
});
Route::get('/personen', [PeopleController::class, 'index'])->name('people.index');
Route::get('/suche', [SearchController::class, 'index'])->name('search');
Route::get('/suche/live', [SearchController::class, 'live'])->middleware('throttle:120,1')->name('search.live');
Route::get('/personen/suche', [PeopleController::class, 'search'])->middleware('throttle:120,1')->name('people.search');
Route::get('/personen/karten', [PeopleController::class, 'cards'])->name('people.cards');
Route::get('/personen/organigramm', [OrganigramController::class, 'index'])->name('people.organigram');
Route::get('/personen/organigramm/{user}/team', [OrganigramController::class, 'team'])->name('people.organigram.team');
Route::get('/benachrichtigungen', [NotificationController::class, 'index'])->name('notifications.index');
Route::post('/benachrichtigungen/gelesen', [NotificationController::class, 'markAllRead'])->name('notifications.read');
Route::get('/benachrichtigungen/{id}', [NotificationController::class, 'open'])->name('notifications.open');
Route::get('/personen/{user}', [PeopleController::class, 'show'])->name('people.show');
Route::get('/profil', [ProfileController::class, 'show'])->name('profile.show');
Route::get('/profil/bearbeiten', [ProfileController::class, 'edit'])->name('profile.edit');
Route::put('/profil', [ProfileController::class, 'update'])->name('profile.update');
Route::post('/profil/bild', [ProfileController::class, 'updateAvatar'])->middleware('throttle:10,1')->name('profile.avatar.update');
Route::delete('/profil/bild', [ProfileController::class, 'destroyAvatar'])->name('profile.avatar.destroy');
Route::post('/profil/apps', [ProfileController::class, 'createToken'])->middleware('throttle:10,1')->name('profile.tokens.store');
Route::delete('/profil/apps/{token}', [ProfileController::class, 'destroyToken'])->whereNumber('token')->name('profile.tokens.destroy');
// Frei gestaltete Startseite (Backend → Startseite → „Startseite gestalten“)
Route::prefix('startseite/gestalten')->name('homepage.')->controller(HomepageEditorController::class)->group(function () {
Route::get('/', 'edit')->name('editor');
Route::put('/entwurf', 'saveDraft')->name('draft');
Route::delete('/entwurf', 'discardDraft')->name('draft.discard');
Route::post('/veroeffentlichen', 'publish')->name('publish');
Route::post('/versionen/{revision}/wiederherstellen', 'restore')->name('restore');
Route::post('/vorschau', 'preview')->middleware('throttle:60,1')->name('preview');
Route::post('/bilder', 'uploadImage')->name('images');
});
// Administration: als andere Person anmelden (Ansicht und Rechte prüfen)
Route::post('/anmelden-als/beenden', [ImpersonationController::class, 'stop'])->name('impersonation.stop');
Route::post('/anmelden-als/{user}', [ImpersonationController::class, 'start'])->whereNumber('user')->name('impersonation.start');
Route::post('/push/abo', [PushController::class, 'subscribe'])->name('push.subscribe');
Route::delete('/push/abo', [PushController::class, 'unsubscribe'])->name('push.unsubscribe');
Route::post('/push/test', [PushController::class, 'test'])->middleware('throttle:5,1')->name('push.test');
Route::post('/profil/titelbild', [ProfileController::class, 'updateCover'])->middleware('throttle:10,1')->name('profile.cover.update');
Route::delete('/profil/titelbild', [ProfileController::class, 'destroyCover'])->name('profile.cover.destroy');
Route::put('/profil/darstellung', [ProfileController::class, 'updateTheme'])->name('profile.theme.update');
});
// Self-Updater (docs/specs/self-updater.md) – nur für Administratoren, CSRF über die web-Gruppe.
Route::middleware(['auth', 'can:updates.manage'])->prefix('admin/update')->name('admin.update.')->group(function () {
Route::post('/check', [UpdateController::class, 'check'])->name('check');
Route::post('/install', [UpdateController::class, 'install'])->name('install');
Route::get('/progress', [UpdateController::class, 'progress'])->name('progress');
Route::post('/channel', [UpdateController::class, 'channel'])->name('channel');
Route::post('/migrations', [UpdateController::class, 'migrations'])->name('migrations');
});
// Plugin-SDK: Oberflächen separat installierter Plugins (nur Dateien aus dist/ aktiver Plugins)
Route::get('/plugin-assets/{slug}/{version}/{path}', PluginAssetController::class)
->where(['slug' => '[a-z0-9-]+', 'version' => '[A-Za-z0-9.+-]+', 'path' => '[A-Za-z0-9_./-]+'])
->name('plugin-assets');