| Conditions | 4 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php namespace Distilleries\Expendable\Http\Controllers\Backend; |
||
| 22 | 2 | public function getSynchronize(Registrar $router) |
|
| 23 | { |
||
| 24 | |||
| 25 | 2 | $routes = $router->getRoutes(); |
|
| 26 | |||
| 27 | 2 | foreach ($routes->getRoutes() as $controller) |
|
| 28 | { |
||
| 29 | 2 | $actions = $controller->getAction(); |
|
| 30 | |||
| 31 | 2 | if (!empty($actions['controller'])) { |
|
| 32 | 2 | $service = $actions['controller']; |
|
| 33 | 2 | $serviceObject = $this->model->getByAction($service); |
|
| 34 | |||
| 35 | 2 | if ($serviceObject->isEmpty()) |
|
| 36 | { |
||
| 37 | 2 | $model = new $this->model; |
|
| 38 | 2 | $model->action = $service; |
|
| 39 | 2 | $model->save(); |
|
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | } |
||
| 45 | |||
| 46 | 2 | return redirect()->back(); |
|
| 47 | } |
||
| 48 | } |