We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 50-67 (lines=18) @@ | ||
| 47 | * @param string $plugin_name |
|
| 48 | * @return mixed |
|
| 49 | */ |
|
| 50 | public function install(string $plugin_name) |
|
| 51 | { |
|
| 52 | $plugin = $this->plugins->whereName($plugin_name); |
|
| 53 | ||
| 54 | if ($plugin->enabled == false) |
|
| 55 | { |
|
| 56 | \DB::transaction( function () use ($plugin) |
|
| 57 | { |
|
| 58 | if ($plugin->handler instanceof Installable) |
|
| 59 | { |
|
| 60 | $plugin->handler->install(); |
|
| 61 | } |
|
| 62 | ||
| 63 | $plugin->enabled = true; |
|
| 64 | ||
| 65 | $plugin->save(); |
|
| 66 | }, 5); |
|
| 67 | } |
|
| 68 | ||
| 69 | return response()->redirectToRoute('products.index'); |
|
| 70 | } |
|
| @@ 79-96 (lines=18) @@ | ||
| 76 | * @param string $plugin_name |
|
| 77 | * @return mixed |
|
| 78 | */ |
|
| 79 | public function uninstall(string $plugin_name) |
|
| 80 | { |
|
| 81 | $plugin = $this->plugins->whereName($plugin_name); |
|
| 82 | ||
| 83 | if ($plugin->enabled == true) |
|
| 84 | { |
|
| 85 | \DB::transaction( function () use ($plugin) |
|
| 86 | { |
|
| 87 | if ($plugin->handler instanceof Installable) |
|
| 88 | { |
|
| 89 | $plugin->handler->uninstall(); |
|
| 90 | } |
|
| 91 | ||
| 92 | $plugin->enabled = false; |
|
| 93 | ||
| 94 | $plugin->save(); |
|
| 95 | }, 5); |
|
| 96 | } |
|
| 97 | ||
| 98 | return response()->redirectToRoute('products.index'); |
|
| 99 | } |
|