| @@ 13-50 (lines=38) @@ | ||
| 10 | * |
|
| 11 | * @package Acacha\AdminLTETemplateLaravel\Console |
|
| 12 | */ |
|
| 13 | class ControllerResourceRoute extends Route |
|
| 14 | { |
|
| 15 | use Controller; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Route constructor. |
|
| 19 | * |
|
| 20 | * @param StubFileCompiler $compiler |
|
| 21 | * @param Filesystem $filesystem |
|
| 22 | */ |
|
| 23 | public function __construct(StubFileCompiler $compiler, Filesystem $filesystem) |
|
| 24 | { |
|
| 25 | parent::__construct($compiler, $filesystem); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Get stub path. |
|
| 30 | * |
|
| 31 | * @return mixed |
|
| 32 | */ |
|
| 33 | protected function getStubPath() |
|
| 34 | { |
|
| 35 | return __DIR__ . '/../stubs/route_with_resource_controller.stub'; |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Obtain replacements for stub. |
|
| 40 | * |
|
| 41 | * @return mixed |
|
| 42 | */ |
|
| 43 | protected function obtainReplacements() |
|
| 44 | { |
|
| 45 | return [ |
|
| 46 | 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 47 | 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]), |
|
| 48 | ]; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 13-52 (lines=40) @@ | ||
| 10 | * |
|
| 11 | * @package Acacha\AdminLTETemplateLaravel\Console |
|
| 12 | */ |
|
| 13 | class ControllerRoute extends Route |
|
| 14 | { |
|
| 15 | use Controller; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Route constructor. |
|
| 19 | * |
|
| 20 | * @param StubFileCompiler $compiler |
|
| 21 | * @param Filesystem $filesystem |
|
| 22 | */ |
|
| 23 | public function __construct(StubFileCompiler $compiler,Filesystem $filesystem) |
|
| 24 | { |
|
| 25 | parent::__construct($compiler,$filesystem); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Get stub path. |
|
| 30 | * |
|
| 31 | * @return mixed |
|
| 32 | */ |
|
| 33 | protected function getStubPath() |
|
| 34 | { |
|
| 35 | return __DIR__ . '/../stubs/route_with_controller.stub'; |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Obtain replacements. |
|
| 40 | * |
|
| 41 | * @return array |
|
| 42 | */ |
|
| 43 | protected function obtainReplacements() |
|
| 44 | { |
|
| 45 | return [ |
|
| 46 | 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 47 | 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]), |
|
| 48 | 'ROUTE_METHOD' => $this->getReplacements()[2], |
|
| 49 | ]; |
|
| 50 | } |
|
| 51 | ||
| 52 | } |
|
| 53 | ||
| @@ 13-48 (lines=36) @@ | ||
| 10 | * |
|
| 11 | * @package Acacha\AdminLTETemplateLaravel\Console |
|
| 12 | */ |
|
| 13 | class RegularRoute extends Route |
|
| 14 | { |
|
| 15 | ||
| 16 | /** |
|
| 17 | * RegularRoute constructor. |
|
| 18 | * |
|
| 19 | * @param StubFileCompiler $compiler |
|
| 20 | * @param Filesystem $filesystem |
|
| 21 | */ |
|
| 22 | public function __construct(StubFileCompiler $compiler, Filesystem $filesystem) |
|
| 23 | { |
|
| 24 | parent::__construct($compiler, $filesystem); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Get path to stub. |
|
| 29 | * |
|
| 30 | * @return string |
|
| 31 | */ |
|
| 32 | protected function getStubPath() |
|
| 33 | { |
|
| 34 | return __DIR__ . '/../stubs/route.stub'; |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @return array |
|
| 39 | */ |
|
| 40 | protected function obtainReplacements() |
|
| 41 | { |
|
| 42 | return [ |
|
| 43 | 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 44 | 'ROUTE_VIEW' => $this->getReplacements()[1], |
|
| 45 | 'ROUTE_METHOD' => $this->getReplacements()[2], |
|
| 46 | ]; |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||