Remove the specified resource from storage.

@param \TypiCMS\Modules\Menulinks\Models\Menulink $menulink

@return \Illuminate\Http\JsonResponse
165714
public function destroy(Menu $menu, Menulink $menulink)
    {
        $deleted = $this->repository->delete($menulink);
        Menus::forgetCache();

        return response()->json([
            'error' => !$deleted,
        ]);
    }
251186
public function delete($menus = array())
    {
        $rst = $this->_request->post($this->_url . 'menu/delete', $menus);
        return $this->_client->rst($rst);
    }
542137
public function destroy($id)
      {
        if ( \Auth::user()->roles[0]->can('menu-delete' ) ) {
          $this->menus->findOrFail($id)->delete();
          return \Redirect::route('admin.menus.index', [
            ])->withMessage(trans('acl::menu.menus-controller-successfully_deleted'));
          }
          return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
        }
742180
public function deleteResourceLink($resourcelink) {
        global $DB;

        $resourcelinkid = $resourcelink->getRecordId();

        // Delete any outstanding share keys for resource links for this consumer.
        $DB->delete_records($this->sharekeytable, ['resourcelinkid' => $resourcelinkid]);

        // Delete users.
        $DB->delete_records($this->userresulttable, ['resourcelinkid' => $resourcelinkid]);

        // Update any resource links for which this is the primary resource link.
        $records = $DB->get_records($this->resourcelinktable, ['primaryresourcelinkid' => $resourcelinkid]);
        foreach ($records as $record) {
            $record->primaryresourcelinkid = null;
            $DB->update_record($this->resourcelinktable, $record);
        }

        // Delete resource link.
        $DB->delete_records($this->resourcelinktable, ['id' => $resourcelinkid]);

        $resourcelink->initialize();

        return true;
    }
509389
public function deleteMenu($lang, $menuID)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Menu', 'delete')) {
            return $this->noPermission();
        }

        $menu = Menu::find($menuID);
        if(!$menu) {
            return $this->response("Menu doesn't exist", 400);
        }

        if(!$menu->isPrimary) {
            $menuLinks = MenuLink::where('menuID', $menuID);
            $menuLinks->delete();
            $menu->delete();
            return $this->response("Menu deleted", 200, Menu::getPrimaryMenuID());
        }else{
            return $this->response("Primary menu can not be deleted", 400);
        }
    }
813427
public function store(Menu $menu, MenulinkFormRequest $request)
    {
        $data = $request->all();
        $data['parent_id'] = null;
        $data['page_id'] = $data['page_id'] ?? null;
        $data['position'] = $data['position'] ?? 0;
        $model = $this->repository->create($data);
        Menus::forgetCache();

        return $this->redirect($request, $model);
    }
641319
public function delete_cache($id_menu){
    $this->options->delete_cache($this->from_path('menus'), true);
    return $this->cache_delete($id_menu);
  }
1220022
public static function remove(string $link = ''): bool
    {
        $link = static::normalizePath($link);
        if (static::exists($link)) {
            return @\unlink($link);
        }
        return false;
    }
897355
private static function checkCategoryMatch(&$currentMenuLinkIDs, $menuLink)
    {
        // check for category match
        if (Meta::getModelData()
            && isset($menuLink->params->categoryID)
            && isset(Meta::getModelData()->categories)
            && count(Meta::getModelData()->categories)
        ) {
            foreach(Meta::getModelData()->categories as $category){
                if($category->categoryID === $menuLink->params->categoryID) {
                    array_push($currentMenuLinkIDs, $menuLink->menuLinkID);

                    // append its parents too
                    foreach (self::parentID($menuLink->menuLinkID) as $parentID) {
                        array_push($currentMenuLinkIDs, $parentID);
                    }
                }
            }
        }

    }
536002
public function handle($symlink)
    {
        $symlink = $this->filesystem->getAdapter()->applyPathPrefix($symlink);

        if (!\is_link($symlink)) {
            return false;
        }

        if (Console::isWindows() && \is_dir($symlink)) {
            return \rmdir($symlink);
        } else {
            return \unlink($symlink);
        }
    }
435558
public function unlinkRichMenu($userId)
    {
        $url = sprintf('%s/v2/bot/user/%s/richmenu', $this->endpointBase, urlencode($userId));
        return $this->httpClient->delete($url);
    }
775863
public function removeMenu(\Fulgurio\LightCMSBundle\Entity\PageMenu $menu)
    {
        $this->menu->removeElement($menu);
    }
1170150
public function remove_child(custom_menu_item $menuitem) {
        $removed = false;
        if (($key = array_search($menuitem, $this->children)) !== false) {
            unset($this->children[$key]);
            $this->children = array_values($this->children);
            $removed = true;
        } else {
            foreach ($this->children as $child) {
                if ($removed = $child->remove_child($menuitem)) {
                    break;
                }
            }
        }
        return $removed;
    }
701116
private static function setParams($menuLink)
    {
        $menuLinkParams = self::decodeParams($menuLink->params);
        $routeParams = Route::getRoutes()->getByName($menuLink->routeName)->parameterNames();
        $params = [];
        foreach($routeParams as $key){
            if(isset($menuLinkParams[$key])) {
                $params[$key] = $menuLinkParams[$key];
            }
        }
        return $params;
    }
540704
public function removePageLink($index = null) {
        if ($index) {
            $return = $this->links->offsetGet($index);
            $this->links->offsetUnset($index);
            return $return;
        } else {
            return $this->links->pop();
        }
    }
409134
public function loadResourceLink($resourceLink)
    {

        $now = time();
        $resourceLink->created = $now;
        $resourceLink->updated = $now;

        return true;

    }
648189
public static function cmsMenuLinks($menuLinks = [])
    {
        $links = [];
        $count = 0;

        if($menuLinks) {
            foreach($menuLinks as $menuLink){
                if($menuLink->belongsTo == "post_type") {
                    $permission = User::hasAccess($menuLink->slug, "read");
                }elseif($menuLink->belongsTo == "category") {
                    $permission = User::hasAccess("Category", "read");
                }else{
                    $permission = User::hasAccess($menuLink->slug, "update");
                }

                $routeURL = self::getActionOfLink($menuLink);
                if($routeURL) {
                    $links[$count] = [
                        'label' => $menuLink->label,
                        'menuLinkID' => $menuLink->menuLinkID,
                        'link' => self::removeDomainFromLink($routeURL),
                        'icon' => '',
                        'access' => $permission,
                        'children' => self::cmsMenuLinks($menuLink->children),
                    ];
                    $count++;
                }
            }
        }
        if(!count($links)) {
            return [];
        }
        return $links;
    }