File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -453,8 +453,10 @@ protected static function createModel(...$args)
453453 {
454454 $ module = $ args [0 ];
455455 $ modelName = '' ;
456+ $ location = "Models " ;
457+ $ lastArg = $ args [3 ];
456458
457- $ nonModuleModel = str_contains ($ args [ 0 ] , '--name ' );
459+ $ nonModuleModel = str_contains ($ module , '--name ' );
458460
459461 if ($ nonModuleModel ) {
460462 $ args [3 ] = $ args [2 ];
@@ -486,6 +488,10 @@ protected static function createModel(...$args)
486488 if (isset ($ args [3 ])) {
487489 $ removeModel = $ args [3 ];
488490 }
491+
492+ if ($ args [3 ] == '--dir ' ) {
493+ $ location = $ lastArg ;
494+ }
489495
490496 if ($ modelType == '--remove-model ' ) {
491497 $ output = " \n" ;
@@ -494,8 +500,16 @@ protected static function createModel(...$args)
494500 exit ;
495501 }
496502
503+ if ($ modelType == '--dir ' ) {
504+ $ output = " \n" ;
505+ $ output .= ConsoleColor::white (" Please check docs for correct syntax to create:model " , 'light ' , 'red ' ) . " \n" ;
506+ echo $ output . "\n" ;
507+ exit ;
508+ }
509+
497510 if ($ nonModuleModel ) {
498- $ command = Console::phpCommand () . 'create/createnonmodulemodel/ ' . $ modelName . '/ ' . $ modelType . '/ ' . $ removeModel ;
511+ $ location = str_replace ('/ ' ,'_ ' , $ location );
512+ $ command = Console::phpCommand () . 'create/createnonmodulemodel/ ' . $ modelName . '/ ' . $ modelType . '/ ' . $ removeModel . '/ ' . $ location ;
499513 static ::runSystemCommand ($ command );
500514 return ;
501515 }
You can’t perform that action at this time.
0 commit comments