public function destroy($id)
    {
        $link = $this->repository->find($id);
        $menu = $link->menu_id;

        if (empty($link)) {
            Cms::notification('Link not found', 'warning');

            return redirect(route($this->routeBase.'.menus.index'));
        }

        $order = json_decode($link->menu->order);
        $key = array_search($id, $order);
        unset($order[$key]);

        $link->menu->update([
            'order' => json_encode(array_values($order)),
        ]);

        $link->delete();

        Cms::notification('Link deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.menus.edit', [$link->menu_id]));
    }
public function destroy($id)
    {
        $link = $this->repository->find($id);
        $menu = $link->menu_id;

        if (empty($link)) {
            Cms::notification('Link not found', 'warning');

            return redirect(route($this->routeBase.'.menus.index'));
        }

        $order = json_decode($link->menu->order);
        $key = array_search($id, $order);
        unset($order[$key]);

        $link->menu->update([
            'order' => json_encode(array_values($order)),
        ]);

        $link->delete();

        Cms::notification('Link deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.menus.edit', [$link->menu_id]));
    }
public function destroy ( $ id ) { $ link = $ this -> repository -> find ( $ id ) ; $ menu = $ link -> menu_id ; if ( empty ( $ link ) ) { Cms :: notification ( 'Link not found' , 'warning' ) ; return redirect ( route ( $ this -> routeBase . '.menus.index' ) ) ; } $ order = json_decode ( $ link -> menu -> order ) ; $ key = array_search ( $ id , $ order ) ; unset ( $ order [ $ key ] ) ; $ link -> menu -> update ( [ 'order' => json_encode ( array_values ( $ order ) ) , ] ) ; $ link -> delete ( ) ; Cms :: notification ( 'Link deleted successfully.' , 'success' ) ; return redirect ( route ( $ this -> routeBase . '.menus.edit' , [ $ link -> menu_id ] ) ) ; }
Remove the specified Links from storage.

@param int $id

@return Response
Remove the specified Links from storage .