Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cleaner Bundle Laravel Package

adgoal/cleaner-bundle

Symfony bundle integrating lamoda/cleaner. Configure DB and custom storage cleaners via YAML, including transactional mode, parameters, and multi-query setups. Provides a console command to run all cleaners or a selected one (cleaner:clear).

View on GitHub
Deep Wiki
Context7

Lamoda cleaner bundle

Build Status Scrutinizer Code Quality Code Coverage Build Status

Symfony Bundle for lamoda/cleaner library.

Installation

  1. Install the Bundle with composer:
$ composer require adgoal/cleaner-bundle
  1. Enable the Bundle:
<?php
// config/bundles.php

return [
    // ...
    Lamoda\CleanerBundle\LamodaCleanerBundle::class => ['all' => true],
    // ...
];
  1. Configure cleaners for your project:
lamoda_cleaner:
    db:
        queue:
            transactional: false  # optional, default true
            query: DELETE FROM queue WHERE created_at < NOW() - (:interval || ' days')::interval
            parameters:
                interval: 30
            types:  # optional, if required special type handling
                - integer

        # you can use multiple queries at one command
        multi_tables:
            class: Lamoda\Cleaner\DB\DoctrineDBALCleaner
            transactional: true
            queries:
                - query: DELETE FROM table_a WHERE created_at < NOW() - (:interval || ' days')::interval
                  parameters:
                      interval: 30
                - query: DELETE FROM table_b WHERE created_at < NOW() - (:interval || ' days')::interval
                  parameters:
                      interval: 30

You can also add your own storage cleaners. To do this you have to implement Lamoda\Cleaner\CleanerInterface and register your cleaner with tag:

services:
    custom_cleaner:
        class: My\Custom\Implementation
        tags:
            - { name: 'lamoda_cleaner.db', alias: 'custom' }

Usage

Bundle adds command to run cleaners.

Run all cleaners in DB:

./bin/console cleaner:clear db

or only one of them:

./bin/console cleaner:clear db queue
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware