You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: readme.md
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,12 @@ Install Garbage Man:
29
29
$ composer require spinen/laravel-garbage-man
30
30
```
31
31
32
+
### For >= Laravel 5.5, you are done with the Install
33
+
34
+
The package uses the auto registration feature
35
+
36
+
### For < Laravel 5.5, you have to register the Service Provider
37
+
32
38
Add the Service Provider to `config/app.php`:
33
39
34
40
```php
@@ -38,12 +44,6 @@ Add the Service Provider to `config/app.php`:
38
44
];
39
45
```
40
46
41
-
Publish the package config file to `config/garbageman.php`:
42
-
43
-
```bash
44
-
$ php artisan vendor:publish
45
-
```
46
-
47
47
## Using the command
48
48
49
49
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)
67
67
68
68
## Configuration
69
69
70
-
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.
70
+
Publish the package config file to `config/garbageman.php`:
71
+
72
+
```bash
73
+
$ php artisan vendor:publish
74
+
```
71
75
72
-
There are 3 main configuration items...
76
+
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...
73
77
74
78
1. Fire purge events - Fire events on purge of each record.
75
79
2. Logging level - Level to log.
76
80
3. Schedule - Models & number of days to allow the soft deleted record to stay.
77
81
78
82
### Fire purge events (fire\_purge\_events)
83
+
79
84
Allow hook into the purge of each record by throwing events before & after deleting of each record. There are 2 events thrown:
80
85
81
86
* garbageman.purging:\<full/model/name\>
@@ -86,6 +91,7 @@ The model is passed with each of the events. The "purging" event is thrown just
86
91
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.
87
92
88
93
### Logging level (logging_level)
94
+
89
95
The level that log messages are generated, which will display information on the console output and in the logs.
0 commit comments