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