json($this->uniqElements($arr)); } #[Route('/', name: 'home', methods: ['POST'])] public function home(Request $request): Response { $array = $request->get('arr'); $errors = ArrayValidation::validate($array); if (count($errors) > 0) { return new Response((string)$errors); } $result = $this->functions->prepareMenu($array); return $this->json($result); } }