falcon/laravel-medialibrary-prune-files

Laravel package to prune stale files created by spatie medialibrary

Installs: 347

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:package

pkg:composer/falcon/laravel-medialibrary-prune-files

1.2.1 2024-08-27 11:59 UTC

This package is auto-updated.

Last update: 2025-09-27 14:42:36 UTC


README

Laravel package to prune stale files created by spatie medialibrary

Install

composer require falcon/laravel-medialibrary-prune-files

Run

Basic ussage

php artisan media-library:prune-files app/public

Checks for media folders inside of a filesystem disk that do not have a media library record in the database.

A folder is an "media folder" if:

  • the folder name is numeric AND
  • the folder contains only files OR the directories within the are either responsive-images or conversions

If you want to just check what files are going to be deleted, you can use the --dry-run command option

php artisan media-library:prune-files app/public --dry-run

BY default the package will use the local disk. To change it use the --disk option

php artisan media-library:prune-files media-libary --dry-run --disk=public

Change log

v1.0.0 - 29-04-2020

  • Initial release