App\Repositories\CommentRepository::destroy PHP Method

destroy() public method

public destroy ( $id )
    public function destroy($id)
    {
        $comment = $this->getById($id);
        $comment->delete();
    }

Usage Example

Example #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Illuminate\Http\Request $request
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request, $id)
 {
     $this->comment_gestion->destroy($id);
     if ($request->ajax()) {
         return response()->json(['id' => $id]);
     }
     return redirect('comment');
 }
All Usage Examples Of App\Repositories\CommentRepository::destroy