user(); // Hervorgehobene Beiträge für den Slider; ohne Hervorhebung die neuesten mit Bild. $featured = NewsPost::query()->published()->with('category') ->where('is_featured', true)->whereNotNull('cover_path') ->latest('published_at')->limit(5)->get(); if ($featured->isEmpty()) { $featured = NewsPost::query()->published()->with('category') ->whereNotNull('cover_path')->latest('published_at')->limit(3)->get(); } $recent = NewsPost::query()->published()->with('category') ->whereKeyNot($featured->modelKeys()) ->latest('published_at')->limit(8)->get(); return Inertia::render('Dashboard', [ 'profile' => [ 'job_title' => $user->job_title, 'department' => $user->department, 'location' => $user->location, 'avatar_url' => $user->avatarUrl(256), ], 'quickLinks' => $quickLinks->all(), 'featuredNews' => NewsPostResource::collection($featured), 'latestNews' => NewsPostResource::collection($recent->take(4)->values()), 'moreNews' => NewsPostResource::collection($recent->slice(4)->values()), 'upcomingEvents' => EventResource::collection(Event::query()->upcoming()->limit(4)->get()), 'newColleagues' => PersonResource::collection( User::query() ->active() ->whereKeyNot($user->getKey()) ->where('created_at', '>=', now()->subDays(90)) ->latest() ->limit(6) ->get() ), 'peopleCount' => User::query()->active()->count(), ]); } }