| @@ 122-135 (lines=14) @@ | ||
| 119 | * |
|
| 120 | * @return mixed |
|
| 121 | */ |
|
| 122 | protected function getMenuCode() |
|
| 123 | { |
|
| 124 | $type = $this->option('type'); |
|
| 125 | $class = isset(static::$lookup[$type]) |
|
| 126 | ? static::$lookup[$type] |
|
| 127 | : RegularMenu::class; |
|
| 128 | /** @var GeneratesCode $route */ |
|
| 129 | $route = new $class($this->compiler, $this->filesystem); |
|
| 130 | $route->setReplacements([ |
|
| 131 | $this->argument('link'), |
|
| 132 | $this->name() |
|
| 133 | ]); |
|
| 134 | return $route->code(); |
|
| 135 | } |
|
| 136 | ||
| 137 | /** |
|
| 138 | * Get path from file resource. |
|
| @@ 244-258 (lines=15) @@ | ||
| 241 | * |
|
| 242 | * @return mixed |
|
| 243 | */ |
|
| 244 | protected function getRouteCode() |
|
| 245 | { |
|
| 246 | $type = $this->option('type'); |
|
| 247 | $class = isset(static::$lookup[$type]) |
|
| 248 | ? static::$lookup[$type] |
|
| 249 | : RegularRoute::class; |
|
| 250 | /** @var GeneratesCode $route */ |
|
| 251 | $route = new $class($this->compiler, $this->filesystem); |
|
| 252 | $route->setReplacements([ |
|
| 253 | $this->argument('link'), |
|
| 254 | $this->action(), |
|
| 255 | $this->method() |
|
| 256 | ]); |
|
| 257 | return $route->code(); |
|
| 258 | } |
|
| 259 | ||
| 260 | /** |
|
| 261 | * Get method. |
|