generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Feature: Console Command Generator Command added
- Bug Fixes: Proper discovery of commands and namespace generation in the module.provider generator - Added ConsoleMakeCommand and tested with a generation of a couple of commands
- Loading branch information
1 parent
d5929c8
commit 6db2fe1
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Savannabits\Modular\Commands; | ||
|
||
|
||
use Savannabits\Modular\Facades\Modular; | ||
use Savannabits\Modular\Support\Concerns\GeneratesModularFiles; | ||
|
||
class ConsoleMakeCommand extends \Illuminate\Foundation\Console\ConsoleMakeCommand | ||
{ | ||
use GeneratesModularFiles; | ||
protected $name = 'modular:make-command'; | ||
|
||
protected $description = 'Create a new Artisan command in a modular package'; | ||
|
||
protected function getStub(): string | ||
{ | ||
$relativePath = '/stubs/console.stub'; | ||
|
||
return file_exists($customPath = $this->laravel->basePath(trim($relativePath, '/'))) | ||
? $customPath | ||
: (file_exists($packagePath = Modular::packagePath(trim($relativePath, '/'))) ? $packagePath : __DIR__.$relativePath); | ||
} | ||
|
||
protected function getRelativeNamespace(): string | ||
{ | ||
return '\\Console\\Commands'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters