Download the PHP package masterro/laravel-file-cleaner without Composer

On this page you can find all versions of the php package masterro/laravel-file-cleaner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-file-cleaner

Latest Stable Version Total Downloads Build Status License

StandWithUkraine

File Cleaner for Laravel

File Cleaner is a package for Laravel 5+ that provides deleting files and associated model instances.

Installation

Step 1: Composer

From the command line, run:

Step 2: Service Provider (For Laravel < 5.5)

For your Laravel app, open config/app.php and, within the providers array, append:

This will bootstrap the package into Laravel.

Step 3: Publish Configs

First from the command line, run:

After that you will see file-cleaner.php file in config directory

For this package you may set such configurations:

Voter callback

Additionally, you can set a static voter callback or invokable object to have more power on controlling deletion logic.
You can register it in one of yours Service providers. The callback will be called after time_before_remove and excluded_* checks.

If callback return true file and optionally associated record in db will be removed.
If callback return false file and record won't be removed.
Otherwise relation check will be performed.

Usage

Scheduling

Add new command call to schedule function:

Have a look at Laravel's task scheduling documentation, if you need any help.

And that's all. If your cron set up everything will work.

Manual, using artisan console

You can run deleting manually, just run from the command line:

And see the output.

Or if you want to delete files without checking time (just delete all files from all set directories) use the --force flag (or -f shortcut):

You can even override config directories paths, excluded_paths and excluded_files values with --directories, --excluded-paths and --excluded-files options (separate by comma):

Also you can even override remove_directories config value with --remove-directories option:

I will be grateful if you star this project :)


All versions of laravel-file-cleaner with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version ^5.1|^5.2|^5.3|^5.4|^6.0|^7.0|^8.0
illuminate/filesystem Version ^5.1|^5.2|^5.3|^5.4|^6.0|^7.0|^8.0
illuminate/console Version ^5.1|^5.2|^5.3|^5.4|^6.0|^7.0|^8.0
illuminate/database Version ^5.1|^5.2|^5.3|^5.4|^6.0|^7.0|^8.0
nesbot/carbon Version ^1.21|^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package masterro/laravel-file-cleaner contains the following files

Loading the files please wait ....