freescout-cleanup-module/Providers/CleanupServiceProvider.php
Lars Jansen 0dcf5e9c53 feat: attachment cleanup functionality
Introduces a new Artisan command to clean up old and large attachments, saving storage space.

This includes options for:
- Setting minimum age and size criteria
- Performing a dry run before actual deletion
- Limiting the number of attachments processed in one run
- Filtering attachments by mailbox

Also adds a cleanup log to track deleted attachments and total space saved.
2025-06-24 16:33:16 +02:00

47 lines
986 B
PHP

<?php
namespace Modules\Cleanup\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Cleanup\Console\CleanupConversations;
use Modules\Cleanup\Console\CleanupAttachments;
class CleanupServiceProvider extends ServiceProvider {
/**
* Boot the application events.
*
* @return void
*/
public function boot(): void {
$this->registerCommands();
$this->registerMigrations();
}
/**
* Register the Artisan commands.
*
* @return void
*/
private function registerCommands(): void {
$this->commands( [
CleanupConversations::class,
CleanupAttachments::class,
] );
}
/**
* Register migrations.
*/
private function registerMigrations(): void {
$this->loadMigrationsFrom(__DIR__.'/../Database/Migrations');
}
/**
* Register the service provider.
*
* @return void
*/
public function register() {
}
}