From a68460596e1be712730e4ede5994398f01ad7631 Mon Sep 17 00:00:00 2001 From: Stefan Ninic Date: Sun, 29 Aug 2021 01:09:34 +0200 Subject: [PATCH 1/2] Publish make:mail stubs --- .../Foundation/Console/MailMakeCommand.php | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Console/MailMakeCommand.php b/src/Illuminate/Foundation/Console/MailMakeCommand.php index 19bef8db3c33..a872556cfd36 100644 --- a/src/Illuminate/Foundation/Console/MailMakeCommand.php +++ b/src/Illuminate/Foundation/Console/MailMakeCommand.php @@ -86,9 +86,23 @@ protected function buildClass($name) */ protected function getStub() { - return $this->option('markdown') - ? __DIR__.'/stubs/markdown-mail.stub' - : __DIR__.'/stubs/mail.stub'; + return $this->resolveStubPath( + $this->option('markdown') + ? '/stubs/markdown-mail.stub' + : '/stubs/mail.stub'); + } + + /** + * Resolve the fully-qualified path to the stub. + * + * @param string $stub + * @return string + */ + protected function resolveStubPath($stub) + { + return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) + ? $customPath + : __DIR__.$stub; } /** From 92124a6994311e7d1213cf2f0edd9a4a6b8d18a7 Mon Sep 17 00:00:00 2001 From: Stefan Ninic Date: Sun, 29 Aug 2021 01:14:41 +0200 Subject: [PATCH 2/2] Publish make:mail stubs --- src/Illuminate/Foundation/Console/StubPublishCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Foundation/Console/StubPublishCommand.php b/src/Illuminate/Foundation/Console/StubPublishCommand.php index 491a7b4d962b..885f0f5c15dc 100644 --- a/src/Illuminate/Foundation/Console/StubPublishCommand.php +++ b/src/Illuminate/Foundation/Console/StubPublishCommand.php @@ -37,6 +37,8 @@ public function handle() __DIR__.'/stubs/event.stub' => $stubsPath.'/event.stub', __DIR__.'/stubs/job.queued.stub' => $stubsPath.'/job.queued.stub', __DIR__.'/stubs/job.stub' => $stubsPath.'/job.stub', + __DIR__.'/stubs/mail.stub' => $stubsPath.'/mail.stub', + __DIR__.'/stubs/markdown-mail.stub' => $stubsPath.'/markdown-mail.stub', __DIR__.'/stubs/markdown-notification.stub' => $stubsPath.'/markdown-notification.stub', __DIR__.'/stubs/model.pivot.stub' => $stubsPath.'/model.pivot.stub', __DIR__.'/stubs/model.stub' => $stubsPath.'/model.stub',