public function update(CategoryRequest $request, CategoryGroup $categoryGroup, Category $category): JsonResponse
    {
        if ($category->category_group_id !== $categoryGroup->id) {
            abort(404);
        }

        $category->update(
            $request->only('icon')
        );

        foreach ($request->file('icons', []) as $key => $file) {
            if ($categoryGroup->hasFileIcon($key) && $file) {
                $category->icons()->updateOrCreate(
                    ['key' => $key],
                    ['icon' => $file]
                );
            }
        }

        $this->modifySlugs($request);

        $category->updateTranslations(
            $request->input('translations')
        );

        dispatch(
            new RegenerateCategoryFullSlugs($category)
        );

        $this->clearCache();

        return response()->json([
            'state' => 'success',
        ]);
    }