class CleanupOldLabels extends Command (View source)

Class CleanupOldLabels

Artisan command responsible for cleaning up old PDF label files stored on the private "labels" filesystem disk.

This command is intended to be executed by the Laravel scheduler and helps prevent disk space accumulation by deleting label PDFs older than a defined expiration time.

Default behavior:

  • Scans all files in the "labels" disk
  • Deletes files older than 30 minutes

Properties

protected string $signature

The name and signature of the console command.

protected string $description

The console command description.

Methods

int
handle()

Execute the console command.

Details

int handle()

Execute the console command.

Iterates over all files in the private "labels" storage disk and deletes any PDF files whose last modification time exceeds the configured expiration threshold.

Return Value

int

Exit code indicating command execution status