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


PHP Article::delete方法代碼示例

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


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

示例1: destroy

 public function destroy(Article $article)
 {
     $article->delete();
     Cache::forget('article:' . $article->id);
     Cache::forget('article:all');
     return redirect('/');
 }
開發者ID:anti-social,項目名稱:vagga,代碼行數:7,代碼來源:ArticleController.php

示例2: destroy

 public function destroy(Article $article)
 {
     // $id から $article へ変更
     $article->delete();
     \Flash::warning('記事を削除しました。');
     return redirect()->route('articles.index');
 }
開發者ID:yokotakaoru,項目名稱:international_sys,代碼行數:7,代碼來源:ArticlesController.php

示例3: destroy

 public function destroy(Article $article)
 {
     // $article = Article::findOrFail($id);
     $article->delete();
     \Session::flash('flash_message', '記事を削除しました。');
     // return redirect('articles');
     return redirect()->route('articles.index');
 }
開發者ID:akokubu,項目名稱:laravel_sample,代碼行數:8,代碼來源:ArticlesController.php

示例4: destroy

 public function destroy(Article $article)
 {
     $deleted = $article->delete();
     session()->flash('flash_message', 'Article was removed with success');
     if (Request::wantsJson()) {
         return (string) $deleted;
     }
     return redirect('articles');
 }
開發者ID:jp7internet,項目名稱:laravel-apz,代碼行數:9,代碼來源:ArticlesController.php

示例5: destroy

 public function destroy(Article $article)
 {
     if ($article->image) {
         $imageDir = base_path() . config('app.uploads_articles_path') . '/' . $article->id;
         if (is_dir($imageDir)) {
             system("rm -rf " . escapeshellarg($imageDir));
         }
     }
     $article->delete();
     return redirect('/admin/article')->with('flash_success', 'Новость успешно удалена.');
 }
開發者ID:Ravend6,項目名稱:laravel_base_v5.2,代碼行數:11,代碼來源:ArticleController.php

示例6: destroy

 public function destroy(Article $article)
 {
     /*
               $article = Article::findOrFail ( $id );
               $article->delete ();
               Session::flash ( 'flash_message', 'Article successfully deleted!' );
               return redirect ()->route ( 'articles' );
     */
     $article->delete();
     return Redirect::route('articles.index')->with('message', 'Article deleted.');
 }
開發者ID:khatiboss,項目名稱:laravel-users-example,代碼行數:11,代碼來源:ArticlesController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param Article $article
  *
  * @internal param int $id
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     return redirect()->route('admin.articles.index');
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:13,代碼來源:ArticlesController.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param Article $article
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy(Article $article)
 {
     $article->delete();
     Flash::success('Content deleted!');
     return redirect('admin/article');
 }
開發者ID:ambarsetyawan,項目名稱:laravel-blog,代碼行數:12,代碼來源:AdminArticleController.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param $id
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
 }
開發者ID:sandeepv,項目名稱:laravel-starter-site,代碼行數:10,代碼來源:ArticleController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param $id
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     flash()->warning('Artikel telah dihapus!');
     return redirect('dashboard/articles');
 }
開發者ID:kobeuu,項目名稱:bpb-sf,代碼行數:12,代碼來源:ArticlesController.php

示例11: destroy

 public function destroy(Article $article)
 {
     $article->delete();
     session()->flash('flash_message', 'Article was removed with success');
 }
開發者ID:jp7anderson,項目名稱:laravel-apz,代碼行數:5,代碼來源:ArticlesController.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param Request $request
  * @param Article $news
  * @return \Illuminate\Http\Response
  * @throws \Exception
  */
 public function destroy(Request $request, Article $news)
 {
     if ($request->ajax()) {
         $news->delete();
     }
 }
開發者ID:huludini,項目名稱:aura-kingdom-web,代碼行數:14,代碼來源:NewsController.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  ArticleRequest   $request
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     return Redirect::back()->with('flash_message', Lang::get('system.destroy'));
 }
開發者ID:khanhpnk,項目名稱:sbds,代碼行數:11,代碼來源:ArticleController.php

示例14: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  Article $article
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     Flash::success('Your article was removed with success');
     return $this->respondTo(['html' => redirect('articles', 303), 'default' => 'Your article was removed with success']);
 }
開發者ID:jp7rafael,項目名稱:learning-laravel,代碼行數:12,代碼來源:ArticlesController.php

示例15: destroy

 public function destroy(Article $article)
 {
     $article->delete();
     \Flash::success('記事を削除しました。');
     return redirect()->route('articles.index');
 }
開發者ID:kittaka1222takashi,項目名稱:dokoiko,代碼行數:6,代碼來源:ArticlesController.php


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