Browse Source

Use published stub file if it exists

pull/30/head
Nafies Luthfi 5 years ago
parent
commit
e3f921a4d0
  1. 6
      src/Generators/BaseGenerator.php

6
src/Generators/BaseGenerator.php

@ -116,6 +116,12 @@ abstract class BaseGenerator implements GeneratorContract
*/
protected function getStubFileContent(string $stubName)
{
$publishedStubPath = base_path('stubs/simple-crud/'.$stubName.'.stub');
if (is_file($publishedStubPath)) {
return $this->files->get($publishedStubPath);
}
return $this->files->get(__DIR__.'/../stubs/'.$stubName.'.stub');
}

Loading…
Cancel
Save