Orphan files OctoberCMS v1

Hello everyone

Does anyone know how I can debug all the orphaned files in the uploads folder? My hard drive is filling up dramatically due to constant changes in the images associated with my models through the ‘System\Models\File’ relationship.

In versions 2x and 3x, there is the command ‘php artisan october:util purge orphans’.

However, I have a project that still runs on OctoberCMS v1.

Nice day!

Hi @sanPuerquitoPrograma

You could do it manually via php artisan tinker and paste in the following

foreach (\System\Models\File::whereNull('attachment_id')->get() as $file) {
    $file->delete();
}