/** * Remove the specified resource from storage. * * @param int $id * * @return \Illuminate\Http\Response */ public function delete(Request $request) { $CategoryID = $request->route('category'); $categoryData = CategoryData::where('category_blogs_id', '=', $CategoryID)->delete(); // $categoryData->delete(); $Category = Category::find($CategoryID); $Category->delete(); return redirect()->route('cpanel.category.index'); }