/** * Remove the specified resource from storage. * * @param \Yajra\CMS\Entities\Category $category * @return \Illuminate\Http\JsonResponse */ public function destroy(Category $category) { if ($category->isRoot()) { abort(404); } if ($category->has('articles')) { return $this->notifyError(trans('cms::categories.destroy.error')); } $category->delete(); return $this->notifySuccess(trans('cms::categories.destroy.success')); }