fn ($q) => $q->published(), ]) ->where('is_active', true) ->orderBy('sort_order') ->get() ->map(fn ($s) => [ 'id' => $s->id, 'name' => $s->name, 'slug' => $s->slug, 'shortDescription' => $s->short_description, 'description' => $s->description, 'icon' => $s->icon, 'opportunitiesCount' => $s->opportunities_count, 'url' => "/sectores/{$s->slug}", ]); return response()->json(['success' => true, 'data' => $sectors]); } public function show(string $slug): JsonResponse { $sector = Sector::with(['opportunities' => fn ($q) => $q->published()]) ->where('slug', $slug)->firstOrFail(); return response()->json(['success' => true, 'data' => $sector]); } }