protected function scopeOnlyTrashed(QueryBuilder $query) {
        $time = new DateTime();

        return $query
            ->andWhere('o.deletedAt is not NULL')
            ->andWhere(':currentTimestamp > o.deletedAt')
            ->setParameter('currentTimestamp', $time->format('Y-m-d H:i:s'));
    }
protected function scopeOnlyTrashed(QueryBuilder $query) {
        $time = new DateTime();

        return $query
            ->andWhere('o.deletedAt is not NULL')
            ->andWhere(':currentTimestamp > o.deletedAt')
            ->setParameter('currentTimestamp', $time->format('Y-m-d H:i:s'));
    }
protected function scopeOnlyTrashed ( QueryBuilder $ query ) { $ time = new DateTime ( ) ; return $ query -> andWhere ( 'o.deletedAt is not NULL' ) -> andWhere ( ':currentTimestamp > o.deletedAt' ) -> setParameter ( 'currentTimestamp' , $ time -> format ( 'Y-m-d H:i:s' ) ) ; }
Filters everything except trashed entities.

@param QueryBuilder $query
@return QueryBuilder
Filters everything except trashed entities .