当前位置: 首页>>代码示例>>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;未经允许,请勿转载。