Browse Source

Use published stub file if it exists

pull/31/head
Nafies Luthfi 5 years ago
parent
commit
6ae4d7a98d
  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) 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'); return $this->files->get(__DIR__.'/../stubs/'.$stubName.'.stub');
} }

Loading…
Cancel
Save