| @@ 57-71 (lines=15) @@ | ||
| 54 | $this->runAfterHooks(); |
|
| 55 | } |
|
| 56 | ||
| 57 | protected function runBeforeHooks() |
|
| 58 | { |
|
| 59 | $beforeHooks = collect(config('export.before', [])) |
|
| 60 | ->reject(function (string $hook, string $name) { |
|
| 61 | return $this->input->getOption("skip-{$name}"); |
|
| 62 | }); |
|
| 63 | ||
| 64 | if (! count($beforeHooks)) { |
|
| 65 | return; |
|
| 66 | } |
|
| 67 | ||
| 68 | $this->info('Running before hooks...'); |
|
| 69 | ||
| 70 | $this->runHooks($beforeHooks); |
|
| 71 | } |
|
| 72 | ||
| 73 | protected function runAfterHooks() |
|
| 74 | { |
|
| @@ 73-87 (lines=15) @@ | ||
| 70 | $this->runHooks($beforeHooks); |
|
| 71 | } |
|
| 72 | ||
| 73 | protected function runAfterHooks() |
|
| 74 | { |
|
| 75 | $afterHooks = collect(config('export.after', [])) |
|
| 76 | ->reject(function (string $hook, string $name) { |
|
| 77 | return $this->input->getOption("skip-{$name}"); |
|
| 78 | }); |
|
| 79 | ||
| 80 | if (! count($afterHooks)) { |
|
| 81 | return; |
|
| 82 | } |
|
| 83 | ||
| 84 | $this->info('Running after hooks...'); |
|
| 85 | ||
| 86 | $this->runHooks($afterHooks); |
|
| 87 | } |
|
| 88 | ||
| 89 | protected function runHooks(array $hooks) |
|
| 90 | { |
|