diff --git a/.travis.yml b/.travis.yml index 1ad37d0..409b561 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,13 @@ env: matrix: include: - - php: 5.6 + - php: 7.0 env: setup=lowest - - php: 5.6 + - php: 7.0 + env: setup=stable + - php: 7.1 + env: setup=lowest + - php: 7.1 env: setup=stable sudo: false @@ -25,7 +29,7 @@ cache: - $HOME/.composer/cache before_install: - - if [[ $TRAVIS_PHP_VERSION != 7.1 ]] ; then phpenv config-rm xdebug.ini; fi + - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - travis_retry composer self-update install: diff --git a/VERSION b/VERSION index 1d0ba9e..8f0916f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +0.5.0 diff --git a/composer.json b/composer.json index f9334ac..95bf6fb 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,9 @@ ], "require": { "php": ">=5.5.0", - "illuminate/console": "~5.1.10|5.2.*|5.3.*|5.4.*", - "illuminate/log": "~5.1.10|5.2.*|5.3.*|5.4.*", - "illuminate/support": "~5.1.10|5.2.*|5.3.*|5.4.*", + "illuminate/console": "~5.1.10|5.2.*|5.3.*|5.4.*|5.5.*", + "illuminate/log": "~5.1.10|5.2.*|5.3.*|5.4.*|5.5.*", + "illuminate/support": "~5.1.10|5.2.*|5.3.*|5.4.*|5.5.*", "nesbot/carbon": "~1.19" }, "require-dev": { @@ -38,7 +38,16 @@ "Spinen\\GarbageMan\\": "tests" } }, + "extra": { + "laravel": { + "providers": [ + "Spinen\\GarbageMan\\GarbageManServiceProvider" + ] + } + }, "config": { - "preferred-install": "dist" - } + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/readme.md b/readme.md index 30ed8e2..8c03fa1 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,12 @@ Install Garbage Man: $ composer require spinen/laravel-garbage-man ``` +### For >= Laravel 5.5, you are done with the Install + +The package uses the auto registration feature + +### For < Laravel 5.5, you have to register the Service Provider + Add the Service Provider to `config/app.php`: ```php @@ -38,12 +44,6 @@ Add the Service Provider to `config/app.php`: ]; ``` -Publish the package config file to `config/garbageman.php`: - -```bash - $ php artisan vendor:publish -``` - ## Using the command The command is registered with laravel as ```garbageman:purge```. You can run it one of 2 ways... @@ -67,15 +67,20 @@ listed on the [Laravel documentation](http://laravel.com/docs/master/scheduling) ## Configuration -During the install process `config/garbageman.php` is copied to the config directory of the project. That file is fully documented. You will need to make the changes to that file to suit your needs. +Publish the package config file to `config/garbageman.php`: + +```bash + $ php artisan vendor:publish +``` -There are 3 main configuration items... +This file is fully documented. You will need to make the changes to that file to suit your needs. There are 3 main configuration items... 1. Fire purge events - Fire events on purge of each record. 2. Logging level - Level to log. 3. Schedule - Models & number of days to allow the soft deleted record to stay. ### Fire purge events (fire\_purge\_events) + Allow hook into the purge of each record by throwing events before & after deleting of each record. There are 2 events thrown: * garbageman.purging:\ @@ -86,6 +91,7 @@ The model is passed with each of the events. The "purging" event is thrown just This is an expensive operation as it requires a SQL command for each record to delete so that the record can be thrown with the events. Therefore, unless you need to catch the events to preform some other action, leave this false to allow all records per model to get deleted with a single SQL call. ### Logging level (logging_level) + The level that log messages are generated, which will display information on the console output and in the logs. | Level | Description |