newsItemRepository->countCurrentNews()) { // show news only if we have news // NOTE: maybe this should be done in the frontend... $data[] = [ 'position' => 'top-left', 'id' => 1, 'type' => 'news', 'metadata' => [ // arbitrary data that will be store "some time" 'only_unread' => false, ], ]; } return new JsonResponse($data, JsonResponse::HTTP_OK, []); } }