translator = $translator; } /** * Returns translation data given a specific locale and namespace. * * @return \Illuminate\Http\JsonResponse */ public function __invoke(Request $request, string $locale, string $namespace) { $data = $this->translator->getLoader()->load($locale, str_replace('.', '/', $namespace)); return new JsonResponse($data, 200, [ 'E-Tag' => md5(json_encode($data)), // @phpstan-ignore-line ]); } }