|
4 | 4 |
|
5 | 5 | use Illuminate\Console\GeneratorCommand; |
6 | 6 |
|
7 | | -class PresenterMakeCommand extends GeneratorCommand |
| 7 | +class PresenterMakeCommand extends MakePresenterCommand |
8 | 8 | { |
9 | 9 | public $name = 'presenter:make'; |
10 | | - |
11 | | - public $description = 'create a new presenter class'; |
12 | | - |
13 | | - /** |
14 | | - * The type of class being generated. |
15 | | - * |
16 | | - * @var string |
17 | | - */ |
18 | | - protected $type = 'Presenter'; |
19 | | - |
20 | | - /** |
21 | | - * Determine if the class already exists. |
22 | | - * |
23 | | - * @param string $rawName |
24 | | - * @return bool |
25 | | - */ |
26 | | - protected function alreadyExists($rawName) |
| 10 | + |
| 11 | + protected function configure() |
27 | 12 | { |
28 | | - return class_exists($rawName) || |
29 | | - $this->files->exists($this->getPath($this->qualifyClass($rawName))); |
30 | | - } |
31 | | - |
32 | | - /** |
33 | | - * Get the stub file for the generator. |
34 | | - * |
35 | | - * @return string |
36 | | - */ |
37 | | - protected function getStub() |
38 | | - { |
39 | | - return $this->resolveStubPath('/stubs/presenter.stub'); |
40 | | - } |
41 | | - |
42 | | - /** |
43 | | - * Resolve the fully-qualified path to the stub. |
44 | | - * |
45 | | - * @param string $stub |
46 | | - * @return string |
47 | | - */ |
48 | | - protected function resolveStubPath($stub) |
49 | | - { |
50 | | - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) |
51 | | - ? $customPath |
52 | | - : __DIR__ . $stub; |
53 | | - } |
54 | | - |
55 | | - /** |
56 | | - * Get the default namespace for the class. |
57 | | - * |
58 | | - * @param string $rootNamespace |
59 | | - * @return string |
60 | | - */ |
61 | | - protected function getDefaultNamespace($rootNamespace) |
62 | | - { |
63 | | - $configNamespace = config('laravel-presenter.presenter_namespace'); |
64 | | - |
65 | | - return is_null($configNamespace) |
66 | | - ? $rootNamespace . '\Presenters' |
67 | | - : $configNamespace; |
| 13 | + $this->setHidden(true); |
68 | 14 | } |
| 15 | + |
69 | 16 | } |
0 commit comments