original_string: public function clear($type = 'notifications')
      {
          $builder = ($type === 'alerts') ? $this->getAlerts() : $this->getNotifications();
  
          return $this->makeModel()
                          ->getModel()
                          ->read()
                          ->getModel()
                          ->newQuery()
                          ->whereIn('stack_id', $builder->pluck('id'))->delete();
      }
code: public function clear($type = 'notifications')
      {
          $builder = ($type === 'alerts') ? $this->getAlerts() : $this->getNotifications();
  
          return $this->makeModel()
                          ->getModel()
                          ->read()
                          ->getModel()
                          ->newQuery()
                          ->whereIn('stack_id', $builder->pluck('id'))->delete();
      }
code_tokens: public function clear ( $ type = 'notifications' ) { $ builder = ( $ type === 'alerts' ) ? $ this -> getAlerts ( ) : $ this -> getNotifications ( ) ; return $ this -> makeModel ( ) -> getModel ( ) -> read ( ) -> getModel ( ) -> newQuery ( ) -> whereIn ( 'stack_id' , $ builder -> pluck ( 'id' ) ) -> delete ( ) ; }
docstring: Deletes all messages
  
  @param String $type
  @return boolean
docstring_tokens: Deletes all messages