示例#1
0
 /**
  * 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');
 }
示例#2
0
 /**
  * Update the specified resource in storage.
  *
  * @param \Illuminate\Http\Request $request
  * @param int                      $id
  *
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request)
 {
     $category_data = new CategoryData();
     $post_data = new PostData();
     $post_id = $request->route('post');
     $info_post = Post::find($post_id);
     $select_category = $category_data->selectBoxCategory(0, '', $info_post->category_id);
     $languages = AppLanguage::orderBy('id')->get();
     return view('admin.article.updatepost', compact('languages', 'post_data', 'post_id', 'select_category'));
 }