Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
46
app/Http/Controllers/DashboardController.php
Executable file
46
app/Http/Controllers/DashboardController.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\ParticipantStatus;
|
||||
use App\Models\Event;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
$query = Event::with(['team', 'participants'])
|
||||
->withCount([
|
||||
'caterings as caterings_yes_count' => fn ($q) => $q->where('status', 'yes'),
|
||||
'timekeepers as timekeepers_yes_count' => fn ($q) => $q->where('status', 'yes'),
|
||||
])
|
||||
->published();
|
||||
|
||||
if (! $user->canAccessAdminPanel()) {
|
||||
$query->whereIn('team_id', $user->accessibleTeamIds());
|
||||
}
|
||||
|
||||
// Alle Events für den Kalender
|
||||
$calendarEvents = $query->orderBy('start_at')->get()
|
||||
->map(fn (Event $e) => [
|
||||
'id' => $e->id,
|
||||
'title' => $e->title,
|
||||
'type' => $e->type->value,
|
||||
'typeLabel' => $e->type->label(),
|
||||
'date' => $e->start_at->format('Y-m-d'),
|
||||
'time' => $e->start_at->format('H:i'),
|
||||
'team' => $e->team->name,
|
||||
'url' => route('events.show', $e),
|
||||
'tl' => [
|
||||
'y' => $e->participants->where('status', ParticipantStatus::Yes)->count(),
|
||||
'n' => $e->participants->where('status', ParticipantStatus::No)->count(),
|
||||
'o' => $e->participants->where('status', ParticipantStatus::Unknown)->count(),
|
||||
],
|
||||
'minMet' => $e->minimumsStatus(),
|
||||
]);
|
||||
|
||||
return view('dashboard', compact('calendarEvents'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user