@@ -32,6 +32,7 @@ class ModelMakeCommand extends GeneratorCommand
32
32
/**
33
33
* Execute the console command.
34
34
*
35
+ * @codeCoverageIgnore
35
36
* @return void
36
37
*/
37
38
public function handle ()
@@ -40,96 +41,96 @@ public function handle()
40
41
return false ;
41
42
}
42
43
43
- if ($ this ->option ('all ' )) {
44
- $ this ->input ->setOption ('factory ' , true );
45
- $ this ->input ->setOption ('seed ' , true );
46
- $ this ->input ->setOption ('migration ' , true );
47
- $ this ->input ->setOption ('controller ' , true );
48
- $ this ->input ->setOption ('resource ' , true );
49
- }
50
-
51
- if ($ this ->option ('factory ' )) {
52
- $ this ->createFactory ();
53
- }
54
-
55
- if ($ this ->option ('migration ' )) {
56
- $ this ->createMigration ();
57
- }
58
-
59
- if ($ this ->option ('seed ' )) {
60
- $ this ->createSeeder ();
61
- }
62
-
63
- if ($ this ->option ('controller ' ) || $ this ->option ('resource ' ) || $ this ->option ('api ' )) {
64
- $ this ->createController ();
65
- }
44
+ // if ($this->option('all')) {
45
+ // $this->input->setOption('factory', true);
46
+ // $this->input->setOption('seed', true);
47
+ // $this->input->setOption('migration', true);
48
+ // $this->input->setOption('controller', true);
49
+ // $this->input->setOption('resource', true);
50
+ // }
51
+ //
52
+ // if ($this->option('factory')) {
53
+ // $this->createFactory();
54
+ // }
55
+ //
56
+ // if ($this->option('migration')) {
57
+ // $this->createMigration();
58
+ // }
59
+ //
60
+ // if ($this->option('seed')) {
61
+ // $this->createSeeder();
62
+ // }
63
+ //
64
+ // if ($this->option('controller') || $this->option('resource') || $this->option('api')) {
65
+ // $this->createController();
66
+ // }
66
67
}
67
68
68
69
/**
69
70
* Create a model factory for the model.
70
71
*
71
72
* @return void
72
73
*/
73
- protected function createFactory ()
74
- {
75
- $ factory = Str::studly (class_basename ($ this ->argument ('name ' )));
76
-
77
- $ this ->call ('make:factory ' , [
78
- 'name ' => "{$ factory }Factory " ,
79
- '--model ' => $ this ->qualifyClass ($ this ->getNameInput ()),
80
- ]);
81
- }
74
+ // protected function createFactory()
75
+ // {
76
+ // $factory = Str::studly(class_basename($this->argument('name')));
77
+ //
78
+ // $this->call('make:factory', [
79
+ // 'name' => "{$factory}Factory",
80
+ // '--model' => $this->qualifyClass($this->getNameInput()),
81
+ // ]);
82
+ // }
82
83
83
84
/**
84
85
* Create a migration file for the model.
85
86
*
86
87
* @return void
87
88
*/
88
- protected function createMigration ()
89
- {
90
- $ table = Str::snake (Str::pluralStudly (class_basename ($ this ->argument ('name ' ))));
91
-
92
- // if ($this->option('pivot')) {
93
- // $table = Str::singular($table);
94
- // }
95
-
96
- $ this ->call ('make:migration ' , [
97
- 'name ' => "create_ {$ table }_table " ,
98
- '--create ' => $ table ,
99
- ]);
100
- }
89
+ // protected function createMigration()
90
+ // {
91
+ // $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));
92
+ //
93
+ // // if ($this->option('pivot')) {
94
+ // // $table = Str::singular($table);
95
+ // // }
96
+ //
97
+ // $this->call('make:migration', [
98
+ // 'name' => "create_{$table}_table",
99
+ // '--create' => $table,
100
+ // ]);
101
+ // }
101
102
102
103
/**
103
104
* Create a seeder file for the model.
104
105
*
105
106
* @return void
106
107
*/
107
- protected function createSeeder ()
108
- {
109
- $ seeder = Str::studly (class_basename ($ this ->argument ('name ' )));
110
-
111
- $ this ->call ('make:seed ' , [
112
- 'name ' => "{$ seeder }Seeder " ,
113
- ]);
114
- }
108
+ // protected function createSeeder()
109
+ // {
110
+ // $seeder = Str::studly(class_basename($this->argument('name')));
111
+ //
112
+ // $this->call('make:seed', [
113
+ // 'name' => "{$seeder}Seeder",
114
+ // ]);
115
+ // }
115
116
116
117
/**
117
118
* Create a controller for the model.
118
119
*
119
120
* @return void
120
121
*/
121
- protected function createController ()
122
- {
123
- $ controller = Str::studly (class_basename ($ this ->argument ('name ' )));
124
-
125
- $ modelName = $ this ->qualifyClass ($ this ->getNameInput ());
126
-
127
- $ this ->call ('make:controller ' , array_filter ([
128
- 'name ' => "{$ controller }Controller " ,
129
- '--model ' => $ this ->option ('resource ' ) || $ this ->option ('api ' ) ? $ modelName : null ,
130
- '--api ' => $ this ->option ('api ' ),
131
- ]));
132
- }
122
+ // protected function createController()
123
+ // {
124
+ // $controller = Str::studly(class_basename($this->argument('name')));
125
+ //
126
+ // $modelName = $this->qualifyClass($this->getNameInput());
127
+ //
128
+ // $this->call('make:controller', array_filter([
129
+ // 'name' => "{$controller}Controller",
130
+ // '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,
131
+ // '--api' => $this->option('api'),
132
+ // ]));
133
+ // }
133
134
134
135
/**
135
136
* Get the stub file for the generator.
@@ -152,9 +153,10 @@ protected function getStub()
152
153
*/
153
154
protected function resolveStubPath ($ stub )
154
155
{
155
- return file_exists ($ customPath = $ this ->laravel ->basePath (trim ($ stub , '/ ' )))
156
- ? $ customPath
157
- : __DIR__ .$ stub ;
156
+ // return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
157
+ // ? $customPath
158
+ // : __DIR__.$stub;
159
+ return __DIR__ . $ stub ;
158
160
}
159
161
160
162
/**
@@ -165,15 +167,15 @@ protected function resolveStubPath($stub)
165
167
protected function getOptions ()
166
168
{
167
169
return [
168
- ['all ' , 'a ' , InputOption::VALUE_NONE , 'Generate a migration, seeder, factory, and resource controller for the model ' ],
169
- ['controller ' , 'c ' , InputOption::VALUE_NONE , 'Create a new controller for the model ' ],
170
- ['factory ' , 'f ' , InputOption::VALUE_NONE , 'Create a new factory for the model ' ],
170
+ // ['all', 'a', InputOption::VALUE_NONE, 'Generate a migration, seeder, factory, and resource controller for the model'],
171
+ // ['controller', 'c', InputOption::VALUE_NONE, 'Create a new controller for the model'],
172
+ // ['factory', 'f', InputOption::VALUE_NONE, 'Create a new factory for the model'],
171
173
['force ' , null , InputOption::VALUE_NONE , 'Create the class even if the model already exists ' ],
172
- ['migration ' , 'm ' , InputOption::VALUE_NONE , 'Create a new migration file for the model ' ],
173
- ['seed ' , 's ' , InputOption::VALUE_NONE , 'Create a new seeder file for the model ' ],
174
+ // ['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model'],
175
+ // ['seed', 's', InputOption::VALUE_NONE, 'Create a new seeder file for the model'],
174
176
// ['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model'],
175
- ['resource ' , 'r ' , InputOption::VALUE_NONE , 'Indicates if the generated controller should be a resource controller ' ],
176
- ['api ' , null , InputOption::VALUE_NONE , 'Indicates if the generated controller should be an API controller ' ],
177
+ // ['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller'],
178
+ // ['api', null, InputOption::VALUE_NONE, 'Indicates if the generated controller should be an API controller'],
177
179
];
178
180
}
179
181
}
0 commit comments