Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmypuckett committed Aug 1, 2017
2 parents 76dfcbc + 3289875 commit 55b6b9e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.5.0
19 changes: 14 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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
}
22 changes: 14 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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...
Expand All @@ -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:\<full/model/name\>
Expand All @@ -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 |
Expand Down

0 comments on commit 55b6b9e

Please sign in to comment.