File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class DataTablesMakeCommand extends GeneratorCommand
1515 */
1616 protected $ signature = 'datatables:make
1717 {name : The name of the datatable.}
18- {--model : The name of the model to be used.}
18+ {--model= : The name of the model to be used.}
1919 {--model-namespace= : The namespace of the model to be used.}
2020 {--action= : The path of the action view.}
2121 {--table= : Scaffold columns from the table.}
@@ -190,9 +190,13 @@ protected function getModel()
190190 {
191191 $ name = $ this ->getNameInput ();
192192 $ rootNamespace = $ this ->laravel ->getNamespace ();
193- $ model = $ this ->option ('model ' ) || $ this ->option ('model-namespace ' );
193+ $ model = $ this ->option ('model ' ) == '' || $ this ->option ('model-namespace ' );
194194 $ modelNamespace = $ this ->option ('model-namespace ' ) ? $ this ->option ('model-namespace ' ) : $ this ->laravel ['config ' ]->get ('datatables-buttons.namespace.model ' );
195195
196+ if ($ this ->option ('model ' ) != '' ) {
197+ return $ this ->option ('model ' );
198+ }
199+
196200 return $ model
197201 ? $ rootNamespace . '\\' . ($ modelNamespace ? $ modelNamespace . '\\' : '' ) . Str::singular ($ name )
198202 : $ rootNamespace . '\\User ' ;
You can’t perform that action at this time.
0 commit comments