Skip to content

Commit

Permalink
Merge pull request #4 from monkenWu/bugFix
Browse files Browse the repository at this point in the history
create:controller -model bugfix
  • Loading branch information
monkenWu authored May 30, 2020
2 parents 21d1eed + e90b079 commit fed7013
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Commands/Controller/CreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private function extraOption(array $options){
if($value == ""){
$value = CliCreate::getName($options,"model");
}
$this->model = [$value];
$this->model = [ucfirst($value)];
}
if(strstr($key,'model=')){
if($key == "model="){
Expand Down Expand Up @@ -201,8 +201,8 @@ private function writeBasic(){
}
//extend model
if($this->model){
$this->call('create:model',$this->model);
if(in_array("-space",$this->model)){
$this->call('create:model',(array)$this->model);
if(in_array("-space",(array)$this->model)){
$nameSpace = $this->model[count($this->model)-1]."\\".$this->model[0];
$useModels .= "use App\\Models{$nameSpace};\n";
}else{
Expand Down Expand Up @@ -259,8 +259,8 @@ private function writeRest(){
//get Model Namespace
$useModel = "";
if($this->model){
$this->call('create:model',$this->model);
if(in_array("-space",$this->model)){
$this->call('create:model',(array)$this->model);
if(in_array("-space",(array)$this->model)){
$nameSpace = $this->model[count($this->model)-1]."\\".$this->model[0];
$useModel = "App\\Models{$nameSpace};\n";
}else{
Expand Down

0 comments on commit fed7013

Please sign in to comment.