src/Repository/StackRepository.php
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();
    }
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();
    }
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 ( ) ; }
Deletes all messages

@param String $type
@return boolean
Deletes all messages