Skip to content

Commit 1096a58

Browse files
committed
Fix the create:mapped-resources command
1 parent 99b2817 commit 1096a58

File tree

2 files changed

+47
-8
lines changed

2 files changed

+47
-8
lines changed

src/Commands/Bases/CreateScaffoldCommandBase.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected function createResourceFileFromString(ScaffoldInputBase $input)
134134
*/
135135
protected function createLanguage(ScaffoldInputBase $input)
136136
{
137-
if (!$this->option('without-languages')) {
137+
if (!$input->withoutLanguages) {
138138
$this->call(
139139
'create:language',
140140
[
@@ -159,7 +159,7 @@ protected function createLanguage(ScaffoldInputBase $input)
159159
*/
160160
protected function createModel(ScaffoldInputBase $input)
161161
{
162-
if (!$this->option('without-model')) {
162+
if (!$input->withoutModel) {
163163
$this->call(
164164
'create:model',
165165
[
@@ -196,7 +196,7 @@ protected function getCommandInput()
196196
$input->perPage = intval($this->option('models-per-page'));
197197
$input->resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($input->modelName);
198198
$input->fields = trim($this->option('fields'));
199-
$input->formRequest = $this->option('with-form-request');
199+
$input->withFormRequest = $this->option('with-form-request');
200200
$input->controllerDirectory = $this->option('controller-directory');
201201
$input->controllerExtends = $this->option('controller-extends') ?: null;
202202
$input->modelExtends = $this->option('model-extends') ?: null;
@@ -206,6 +206,11 @@ protected function getCommandInput()
206206
$input->primaryKey = $this->option('primary-key');
207207
$input->withSoftDelete = $this->option('with-soft-delete');
208208
$input->withoutTimeStamps = $this->option('without-timestamps');
209+
$input->withoutLanguages = $this->option('without-languages');
210+
$input->withoutModel = $this->option('without-model');
211+
$input->withoutController = $this->option('without-controller');
212+
$input->withoutFormRequest = $this->option('without-form-request');
213+
$input->withoutViews = $this->option('without-views');
209214
$input->migrationClass = $this->option('migration-class-name');
210215
$input->connectionName = $this->option('connection-name');
211216
$input->engineName = $this->option('engine-name');

src/Models/Bases/ScaffoldInputBase.php

+39-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ScaffoldInputBase
6565
*
6666
* @var bool
6767
*/
68-
public $formRequest = false;
68+
public $withFormRequest;
6969

7070
/**
7171
* The controller directory
@@ -89,18 +89,18 @@ class ScaffoldInputBase
8989
public $modelExtends;
9090

9191
/**
92-
* Without migration
92+
* With migration
9393
*
9494
* @var bool
9595
*/
96-
public $withMigration = false;
96+
public $withMigration;
9797

9898
/**
9999
* Override existing files
100100
*
101101
* @var bool
102102
*/
103-
public $force = false;
103+
public $force;
104104

105105
/**
106106
* Models directory
@@ -124,12 +124,46 @@ class ScaffoldInputBase
124124
public $withSoftDelete;
125125

126126
/**
127-
* Without time stamp
127+
* Without timestamp
128128
*
129129
* @var bool
130130
*/
131131
public $withoutTimeStamps;
132132

133+
/**
134+
* Without languages
135+
*
136+
* @var bool
137+
*/
138+
public $withoutLanguages;
139+
140+
/**
141+
* Without model
142+
*
143+
* @var bool
144+
*/
145+
public $withoutModel;
146+
147+
/**
148+
* Without controller
149+
*
150+
* @var bool
151+
*/
152+
public $withoutController;
153+
154+
/**
155+
* Without views
156+
*
157+
* @var bool
158+
*/
159+
public $withoutViews;
160+
161+
/**
162+
* Without form-request
163+
*
164+
* @var bool
165+
*/
166+
public $withoutFormRequest;
133167
/**
134168
* migration class name
135169
*

0 commit comments

Comments
 (0)