Owl\Http\Controllers\ItemController::destroy PHP Method

destroy() public method

public destroy ( $openItemId )
    public function destroy($openItemId)
    {
        $user = $this->userService->getCurrentUser();
        $item = $this->itemService->getByOpenItemId($openItemId);
        if ($item == null || $item->user_id !== $user->id) {
            \App::abort(404);
        }
        $this->itemService->delete($item->id);
        $no_tag = array();
        $this->tagService->syncTags($item, $no_tag);
        return \Redirect::route('items.index');
    }