app/Api/V1/Traits/HasComments.php
/**
     * function to delete comments related to the particular model
     */
function to delete comments related to the particular model
function to delete comments related to the particular model
public function deleteComments()
    {
        if ($comments = $this->comments()->get()) {
            $comments->delete();
        }
        return;
    }
public function deleteComments ( ) { if ( $ comments = $ this -> comments ( ) -> get ( ) ) { $ comments -> delete ( ) ; } return ; }
function to delete comments related to the particular model
function to delete comments related to the particular model