From 6ae4d7a98d2e421be22f08484e9b8f48a4db25de Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Tue, 26 Jan 2021 15:02:11 +0800 Subject: [PATCH] Use published stub file if it exists --- src/Generators/BaseGenerator.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Generators/BaseGenerator.php b/src/Generators/BaseGenerator.php index e532ffd..b38591b 100644 --- a/src/Generators/BaseGenerator.php +++ b/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'); }