public function destroy($id) { $article = Article::findOrFail($id); if (Gate::denies('article_authorize', $article)) { return "authorize fails"; } Article::destroy($id); return redirect('/admin/articles'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Article::destroy($id); return redirect('/admin/articles'); }
public function destroy(Request $request) { $id = $request->get('id'); Article::destroy($id); // return Redirect::back(); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Article::destroy($id); return redirect('/article/')->with('flash_message', 'Article successfully deleted.'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Article::destroy($id); return redirect()->action('Goenitz\\ArticleController@index'); }
public function destroy($id) { Article::destroy($id); return redirect('article'); }
/** * article destroy. * * @return \Illuminate\Http\Response */ public function destroy($id) { // Log::info('Showing user profile for user: '.$id); return response()->json(Article::destroy($id)); }
public function deleteArticle($category, $article) { $category = Category::all()->where('slug', strtolower($category))->first(); Article::destroy(Article::all()->where('slug', strtolower($article))->first()->id); return redirect('/article/' . $category->slug)->with('message', 'Article supprimé avec succès.'); }
/** * Remove the specified resource from storage. * * @param int $id * * @return \Illuminate\Http\Response */ public function destroy(Request $request) { Article::destroy($request->input('ids')); return response()->json(['success' => true, 'message' => 'You did it!']); }
public function destroy($id) { $article = Article::destroy($id); return view('admin.article.index')->withArticles(Article::all()); }
public function destroy($photo) { $article = \App\Article::where('photo', $photo)->firstOrFail(); //权限 $this->authorOrAdminPermissioinRequire($article->user_id); //delete photo File::delete(base_path() . '/public/images/catalog/' . $article->photo . $article->type); if ($article->type = '_long.jpg') { File::delete(base_path() . '/public/images/catalog/' . $article->photo . '.jpg'); } \App\Article::destroy($article->id); return redirect('articles'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $article = Article::destroy($id); flash()->success('Article Archived'); return redirect('articles'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // if (Article::destroy($id)) { return Response::json(['msg' => 'Article deleted']); } else { return Response::json(['error' => 'Records not found'], 404); } }