Loheide-eu-mitarbeiterplatt.../app/Http/Controllers/HubController.php
Friederich Loheide 4d0a2984ec
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 9m9s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 9m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 10m30s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 11m5s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m15s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 13m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m57s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 45s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m20s
Wissen, Service, Gremien-Baustein und Menü-Vorschlag (0.56.0)
Übersichtsseiten /wissen und /service (Hubs, im Admin pflegbar), Baustein
„Mitglieder mit Rolle“, Menü-Vorschlag für die Mitarbeiter-App.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 16:03:08 +00:00

36 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\Plugins\PluginAccess;
use App\Support\Hubs;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use Inertia\Response;
class HubController extends Controller
{
/** /wissen – Suche und die Bereiche zum Nachschlagen */
public function wissen(Request $request, Hubs $hubs): Response
{
return Inertia::render('Hubs/Wissen', [
'entries' => $hubs->forUser('wissen', $request->user()),
]);
}
/** /service – IT und die übrigen Anlaufstellen */
public function service(Request $request, Hubs $hubs): Response
{
$it = Route::has('it-service.index') && app(PluginAccess::class)->allows('it-service', $request->user());
return Inertia::render('Hubs/Service', [
'entries' => $hubs->forUser('service', $request->user()),
'it' => $it ? array_values(array_filter([
Route::has('it-service.tickets.create') ? ['label' => 'Problem melden', 'text' => 'Wir fragen kurz nach, dann geht es los', 'icon' => 'circle-alert', 'url' => route('it-service.tickets.create', absolute: false), 'primary' => true] : null,
Route::has('it-service.loans.devices') ? ['label' => 'Gerät ausleihen', 'text' => 'Laptop, Beamer, Diensthandy', 'icon' => 'laptop', 'url' => route('it-service.loans.devices', absolute: false), 'primary' => false] : null,
['label' => 'Meine IT', 'text' => 'Tickets und Ausleihen im Überblick', 'icon' => 'headset', 'url' => route('it-service.index', absolute: false), 'primary' => false],
])) : null,
]);
}
}