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


PHP Comment::destroy方法代碼示例

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


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

示例1: destroy

 public function destroy($id)
 {
     $comment = Comment::find($id);
     $postId = $comment->post_id;
     Comment::destroy($id);
     return redirect('/posts/' . $postId);
 }
開發者ID:erzhu4,項目名稱:larvelProject,代碼行數:7,代碼來源:CommentsController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $comment = Comment::find($id);
     Comment::destroy($id);
     if (Comment::where('author', $comment->author)->count() < 1) {
         User::where('author', $comment->author)->delete();
     }
     return response()->json(['success' => true]);
 }
開發者ID:schrink,項目名稱:601-AdvancedWebProject,代碼行數:15,代碼來源:CommentController.php

示例3: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     //
     /* 循環刪除
        for($i=0; $i<(count($this->id)); $i++)
        {
            $comment = Comment::findOrFail($this->id[$i]);
            $comment->delete();
        }
         */
     try {
         Comment::destroy($this->id);
     } catch (Exception $e) {
         return response($e->getMessage, 422);
     }
 }
開發者ID:shine1rainbow,項目名稱:blog,代碼行數:21,代碼來源:Destory.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy()
 {
     Comment::destroy(request('id'));
     return back()->with('message', 'Kommentti poistettu!');
 }
開發者ID:partio-scout,項目名稱:kokous_backend,代碼行數:11,代碼來源:CommentController.php

示例5: destroyCt

 public function destroyCt($id)
 {
     //return $id;
     if (Comment::destroy([$id])) {
         return redirect()->back()->with('Mess', 'Đã xóa');
     } else {
         return redirect()->back()->with('errorMess', 'Có lỗi xảy ra, vui lòng thử lại sau!');
     }
 }
開發者ID:JamesNguyen9x,項目名稱:vatc,代碼行數:9,代碼來源:ReviewController.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($commentid, $id)
 {
     Comment::destroy($id);
     return Redirect::route('admin.comment.show', $commentid);
 }
開發者ID:nikajorjika,項目名稱:gamoiwere.ge,代碼行數:11,代碼來源:CommentController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     return response()->json(Comment::destroy($id));
 }
開發者ID:lein00,項目名稱:guestbook,代碼行數:10,代碼來源:CommentController.php

示例8: delete_comment

 public function delete_comment(Request $request)
 {
     return Comment::destroy($request->get('id'));
 }
開發者ID:Hukuta,項目名稱:laravel-blog,代碼行數:4,代碼來源:ArticlesController.php

示例9: destroy

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     Comment::destroy($id);
 }
開發者ID:j1edward1,項目名稱:phpio,代碼行數:11,代碼來源:CommentController.php

示例10: destroy

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

示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     if (Comment::destroy($id)) {
         return response()->json(array('status' => 'ok'));
     }
     return response()->json(array('status' => 'error'));
 }
開發者ID:kelsie1231,項目名稱:StalkyServerSide,代碼行數:14,代碼來源:CommentController.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return response()->json(['success' => true]);
 }
開發者ID:ronal2do,項目名稱:HybridApp,代碼行數:11,代碼來源:CommentController.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return redirect()->to('comment')->with('message', 'success create');
 }
開發者ID:patlegris,項目名稱:ConfPHP,代碼行數:11,代碼來源:CommentController.php

示例14: deletecomment

 public function deletecomment($id)
 {
     Comment::destroy($id);
     Log::warning('Something could be going wrong.');
     return array('success' => true);
 }
開發者ID:aaronleslie,項目名稱:aaronunix,代碼行數:6,代碼來源:CommentController.php

示例15: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return response()->json(['status' => 'success', 'message' => 'Comment Deleted.']);
 }
開發者ID:bluecipherz,項目名稱:bczapi,代碼行數:11,代碼來源:CommentController.php


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