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