File tree Expand file tree Collapse file tree 3 files changed +30
-38
lines changed Expand file tree Collapse file tree 3 files changed +30
-38
lines changed Original file line number Diff line number Diff line change 6
6
7
7
# LaravelFileCleaner
8
8
9
- LaravelFileCleaner - это пакет для Laravel 5.1-5.2 , который позвлоляет удалять временные файлы и связанные с ними сущности модели (при необходимости).
9
+ LaravelFileCleaner - это пакет для Laravel 5, который позвлоляет удалять временные файлы и связанные с ними сущности модели (при необходимости).
10
10
11
11
## Установка
12
12
@@ -51,15 +51,7 @@ php artisan vendor:publish --provider="MasterRO\LaravelFileCleaner\FileCleanerSe
51
51
52
52
### Scheduling
53
53
54
- В Command/Kernel.php добавьте ` FileCleaner::class ` :
55
-
56
- ``` php
57
- protected $commands = [
58
- \MasterRO\LaravelFileCleaner\FileCleaner::class,
59
- ];
60
- ```
61
-
62
- Затем добавьте вызов команды в фукцию ` schedule ` :
54
+ Добавьте вызов команды в фукцию ` schedule ` :
63
55
> [ Документация по Task Scheduling] ( https://laravel.com/docs/5.2/scheduling ) , если есть вопросы.
64
56
65
57
``` php
Original file line number Diff line number Diff line change @@ -66,15 +66,8 @@ For this package you may set such configurations:
66
66
## Usage
67
67
68
68
### Scheduling
69
- In your Command kernel file add ` FileCleaner::class ` :
70
69
71
- ``` php
72
- protected $commands = [
73
- \MasterRO\LaravelFileCleaner\FileCleaner::class,
74
- ];
75
- ```
76
-
77
- Then add new command call to schedule function:
70
+ Add new command call to schedule function:
78
71
> Have a look at [ Laravel's task scheduling documentation] ( https://laravel.com/docs/5.2/scheduling ) , if you need any help.
79
72
80
73
``` php
Original file line number Diff line number Diff line change 7
7
class FileCleanerServiceProvider extends ServiceProvider
8
8
{
9
9
10
- /**
11
- * Boot the service provider.
12
- *
13
- * @return void
14
- */
15
- public function boot ()
16
- {
17
- $ this ->publishes ([
18
- __DIR__ . '/file-cleaner.php ' => config_path ('file-cleaner.php ' ),
19
- ]);
20
- }
10
+ /**
11
+ * Boot the service provider.
12
+ *
13
+ * @return void
14
+ */
15
+ public function boot ()
16
+ {
17
+ $ this ->publishes ([
18
+ __DIR__ . '/file-cleaner.php ' => config_path ('file-cleaner.php ' ),
19
+ ]);
21
20
22
- /**
23
- * Register the service provider.
24
- *
25
- * @return void
26
- */
27
- public function register ()
28
- {
29
- //
30
- }
21
+ if ($ this ->app ->runningInConsole ()) {
22
+ $ this ->commands ([
23
+ FileCleaner::class,
24
+ ]);
25
+ }
26
+ }
27
+
28
+
29
+ /**
30
+ * Register the service provider.
31
+ *
32
+ * @return void
33
+ */
34
+ public function register ()
35
+ {
36
+ //
37
+ }
31
38
}
You can’t perform that action at this time.
0 commit comments