Browse Source

Add console warn for the extsting classes

pull/36/head
Nafies Luthfi 5 years ago
parent
commit
e306d5d4b2
  1. 1
      src/Generators/ModelFactoryGenerator.php
  2. 1
      src/Generators/ModelGenerator.php
  3. 1
      src/Generators/ModelPolicyGenerator.php

1
src/Generators/ModelFactoryGenerator.php

@ -16,6 +16,7 @@ class ModelFactoryGenerator extends BaseGenerator
$modelFactoryClassPath = $modelFactoryPath.'/'.$this->modelNames['model_name'].'Factory.php';
if ($this->files->exists($modelFactoryClassPath)) {
$this->command->warn('Use the existing '.$this->modelNames['model_name'].' model factory.');
return;
}

1
src/Generators/ModelGenerator.php

@ -17,6 +17,7 @@ class ModelGenerator extends BaseGenerator
$modelClassPath = $modelDirectory.'/'.$this->modelNames['model_name'].'.php';
if ($this->files->exists($modelClassPath)) {
$this->command->warn('Use the existing '.$this->modelNames['model_name'].' model.');
return;
}

1
src/Generators/ModelPolicyGenerator.php

@ -20,6 +20,7 @@ class ModelPolicyGenerator extends BaseGenerator
$modelPolicyClassPath = $modelPolicyPath.'/'.$this->modelNames['model_name'].'Policy.php';
if ($this->files->exists($modelPolicyClassPath)) {
$this->command->warn('Use the existing '.$this->modelNames['model_name'].' model policy.');
return;
}

Loading…
Cancel
Save