mirror of
https://gh.wpcy.net/https://github.com/LJPc-solutions/freescout-cleanup-module.git
synced 2026-07-15 06:23:00 +08:00
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.
47 lines
986 B
PHP
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() {
|
|
}
|
|
|
|
}
|