當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Article::destroy方法代碼示例

本文整理匯總了PHP中app\Article::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Article::destroy方法的具體用法?PHP Article::destroy怎麽用?PHP Article::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Article的用法示例。


在下文中一共展示了Article::destroy方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: destroy

 public function destroy($id)
 {
     $article = Article::findOrFail($id);
     if (Gate::denies('article_authorize', $article)) {
         return "authorize fails";
     }
     Article::destroy($id);
     return redirect('/admin/articles');
 }
開發者ID:goyuquan,項目名稱:album,代碼行數:9,代碼來源:ArticleController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Article::destroy($id);
     return redirect('/admin/articles');
 }
開發者ID:TemRhythm,項目名稱:blog,代碼行數:11,代碼來源:ArticleController.php

示例3: destroy

 public function destroy(Request $request)
 {
     $id = $request->get('id');
     Article::destroy($id);
     // return Redirect::back();
 }
開發者ID:uros262,項目名稱:test_projekat_blog_laravel5,代碼行數:6,代碼來源:KontrolerClanaka.php

示例4: destroy

 /**
  * 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.');
 }
開發者ID:adamanything,項目名稱:laravelSimpleCrud,代碼行數:11,代碼來源:ArticleController.php

示例5: destroy

 /**
  * 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');
 }
開發者ID:tianyirenjian,項目名稱:laravel-blog,代碼行數:11,代碼來源:ArticleController.php

示例6: destroy

 public function destroy($id)
 {
     Article::destroy($id);
     return redirect('article');
 }
開發者ID:nnanee,項目名稱:lekcija2,代碼行數:5,代碼來源:ArticleController.php

示例7: destroy

 /**
  * article destroy.
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     // Log::info('Showing user profile for user: '.$id);
     return response()->json(Article::destroy($id));
 }
開發者ID:lavenkin,項目名稱:bugblog,代碼行數:10,代碼來源:ArticleController.php

示例8: deleteArticle

 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.');
 }
開發者ID:soywod,項目名稱:MAD,代碼行數:6,代碼來源:FrontController.php

示例9: destroy

 /**
  * 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!']);
 }
開發者ID:myleshyson,項目名稱:ivgainesville,代碼行數:12,代碼來源:BlogController.php

示例10: destroy

 public function destroy($id)
 {
     $article = Article::destroy($id);
     return view('admin.article.index')->withArticles(Article::all());
 }
開發者ID:jahnni,項目名稱:onamap,代碼行數:5,代碼來源:ArticleController.php

示例11: destroy

 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');
 }
開發者ID:stevejobsii,項目名稱:phphub-laravel5.1,代碼行數:13,代碼來源:ArticlesController.php

示例12: destroy

 /**
  * 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');
 }
開發者ID:chrismoulins,項目名稱:Laravel,代碼行數:12,代碼來源:ArticleController.php

示例13: destroy

 /**
  * 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);
     }
 }
開發者ID:pshanoop,項目名稱:laravel-blog,代碼行數:15,代碼來源:ArticleController.php


注:本文中的app\Article::destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。