Button Response from DataTable request to publish status.

@param  \Yajra\CMS\Entities\Category $category
@return \Illuminate\Http\JsonResponse
199282
public function publish(Category $category)
    {
        $category->togglePublishedState();

        $category->getDescendants()->each(
            function (Category $cat) use ($category) {
                $cat->published = $category->published;
                $cat->save();
            }
        );

        $message = $category->published ? trans('cms::categories.publish.success') : trans('cms::categories.publish.error');

        return $this->notifySuccess($message);
    }
624705
public function make(ICategory $category)
    {
        //$category->setResponse($this->response->view('admin.categorys.view', compact('category')));
        $category->setResponse($this->response->view(\OogleeBConfig::get('config.category_view.view'), compact('category')));
    }
176182
public function addCategory(CategoryInterface $category)
    {
        if (!$this
            ->categories
            ->contains($category)
        ) {
            $this
                ->categories
                ->add($category);
        }

        return $this;
    }
768001
public function update(CategoryRequest $request, Model $category)
    {
        $category->update($request->all());

        return redirect()->route('admin.category.index');
    }
146377
private function createDeleteForm(Category $category)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('ecommerce_category_delete', array('id' => $category->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
1140395
public function setCategory(\Amulen\ClassificationBundle\Entity\Category $category = null)
    {
        $this->category = $category;

        return $this;
    }
794586
protected function updateCategory()
    {
        $this->controlAccess('category_edit');

        if ($this->category->update($this->data_category['category_id'], $this->getSubmitted())) {
            $url = "admin/content/category/{$this->data_category_group['category_group_id']}";
            $this->redirect($url, $this->text('Category has been updated'), 'success');
        }

        $this->redirect('', $this->text('Category has not been updated'), 'warning');
    }
180361
public function addCategory(\Amulen\ClassificationBundle\Entity\Category $category)
    {
        $this->categories[] = $category;

        return $this;
    }
590883
public function showAction(Category $category)
    {
        $deleteForm = $this->createDeleteForm($category);

        return array(
            'entity' => $category,
            'delete_form' => $deleteForm->createView(),
        );
    }
1222113
public function setCategory(\HarvestCloud\CoreBundle\Entity\Category $category)
    {
        $this->category = $category;

        // copy over the path
        $this->setCategoryPath($category->getPath());
    }
1106098
public function addCategory(CategoryEntity $category)
    {
        $fileVersion = $this->getFileVersion();
        $fileVersion->addCategory($category);

        return $this;
    }
1367794
public function update(NewsCategory $category, Request $request)
	{
		$attributes = request()->validate(NewsCategory::$rules, NewsCategory::$messages);

        $category = $this->updateEntry($category, $attributes);

        return redirect_to_resource();
	}
230937
public function subjectFormAction(Category $category)
    {
        $forum = $category->getForum();
        $collection = new ResourceCollection(array($forum->getResourceNode()));

        if (!$this->authorization->isGranted('post', $collection)) {
            throw new AccessDeniedException($collection->getErrorsForDisplay());
        }

        $formSubject = $this->get('form.factory')->create(new SubjectType());

        return array(
            '_resource' => $forum,
            'form' => $formSubject->createView(),
            'category' => $category,
            'workspace' => $forum->getResourceNode()->getWorkspace()
        );
    }
130693
public function addCategory(CategoryInterface $category)
    {
        if (! $this->hasCategory($category)) {
            $this->categories->add($category);
        }

        return $this;
    }
769743
public function serialize(Category $category)
    {
        return [
            'id' => $category->getId(),
            'name' => $category->getName(),
            'order' => $category->getOrder(),
            'user' => $this->userSerializer->serialize($category->getUser()),
        ];
    }
1123772
public function postCategory(CategoryPostMessage $message): Category
    {
        $path = sprintf('sites/%d/categories', $message->getSiteId());
        $data = ['api_category' => $message->build()];

        $response = $this->getClient()->sendRequest(RequestStatus::POST, $path, $data);

        /** @var Category $model */
        $model = $this->getModelFactory()->create(Category::class, $response);

        return $model;
    }
604167
public function update(Category $category, UpdateCategoryRequest $request)
    {
        $this->category->update($category, $request->all());

        return redirect()->route('admin.product.category.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::categories.title.categories')]));
    }