$detail Resource toDetailArray 결과 * @param LanguagePackScope $scope 대상 스코프 * @param string|null $targetIdentifier 대상 식별자 (코어는 null) * @param Request $request HTTP 요청 * @return array language_packs 가 추가된 detail 배열 */ protected function attachLanguagePacks( array $detail, LanguagePackScope $scope, ?string $targetIdentifier, Request $request, ): array { /** @var LanguagePackService $service */ $service = app(LanguagePackService::class); $packs = $service->getPacksForExtension($scope, $targetIdentifier); $detail['language_packs'] = $packs ->map(fn ($pack) => (new LanguagePackResource($pack))->toArray($request)) ->all(); return $detail; } }