first(); $timeline = Experience::query()->get()->map(fn (Experience $item) => (object) [ 'type' => 'work', 'title' => $item->role, 'subtitle' => $item->company, 'start_date' => $item->start_date, 'end_date' => $item->end_date, 'is_current' => $item->is_current, 'description' => $item->description, ])->concat(Education::query()->get()->map(fn (Education $item) => (object) [ 'type' => 'education', 'title' => $item->degree ? $item->degree . ($item->field_of_study ? " in {$item->field_of_study}" : '') : $item->institution, 'subtitle' => $item->institution, 'start_date' => $item->start_date, 'end_date' => $item->end_date, 'is_current' => false, 'description' => $item->description, ]))->sortByDesc(fn (object $item) => $item->start_date)->values(); $projects = Project::query() ->orderByDesc('is_featured') ->orderBy('sort_order') ->orderByDesc('created_at') ->limit(4) ->get(); $posts = Post::query() ->published() ->orderByDesc('published_at') ->limit(3) ->get(); return view('home', compact('profile', 'timeline', 'projects', 'posts')); } }