@@ 9-51 (lines=43) @@ | ||
6 | use LaravelPlus\Extension\Addons\Addon; |
|
7 | use LaravelPlus\Extension\Generators\GeneratorCommandTrait; |
|
8 | ||
9 | class MigrationMakeCommand extends BaseCommand |
|
10 | { |
|
11 | use GeneratorCommandTrait; |
|
12 | ||
13 | /** |
|
14 | * The console command singature. |
|
15 | * |
|
16 | * @var string |
|
17 | */ |
|
18 | protected $signature = 'make:migration |
|
19 | {name : The name of the class} |
|
20 | {--a|addon= : The name of the addon} |
|
21 | {--create= : The table to be created} |
|
22 | {--update= : The table to be updated} |
|
23 | '; |
|
24 | ||
25 | /** |
|
26 | * The console command description. |
|
27 | * |
|
28 | * @var string |
|
29 | */ |
|
30 | protected $description = '[+] Create a new migration class'; |
|
31 | ||
32 | /** |
|
33 | * The constructor. |
|
34 | */ |
|
35 | public function __construct() |
|
36 | { |
|
37 | parent::__construct(); |
|
38 | ||
39 | $this->setStubDirectory(__DIR__.'/../stubs'); |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * Get the default namespace for the class. |
|
44 | * |
|
45 | * @return string |
|
46 | */ |
|
47 | protected function getDefaultNamespace() |
|
48 | { |
|
49 | return $this->getRootNamespace().'\\'.($this->onAddon() ? 'Migrations' : 'Database\\Migrations'); |
|
50 | } |
|
51 | } |
|
52 |
@@ 9-49 (lines=41) @@ | ||
6 | use LaravelPlus\Extension\Addons\Addon; |
|
7 | use LaravelPlus\Extension\Generators\GeneratorCommandTrait; |
|
8 | ||
9 | class SeederMakeCommand extends BaseCommand |
|
10 | { |
|
11 | use GeneratorCommandTrait; |
|
12 | ||
13 | /** |
|
14 | * The console command singature. |
|
15 | * |
|
16 | * @var stringphp |
|
17 | */ |
|
18 | protected $signature = 'make:seeder |
|
19 | {name : The name of the class} |
|
20 | {--a|addon= : The name of the addon} |
|
21 | '; |
|
22 | ||
23 | /** |
|
24 | * The console command description. |
|
25 | * |
|
26 | * @var string |
|
27 | */ |
|
28 | protected $description = '[+] Create a new seeder class'; |
|
29 | ||
30 | /** |
|
31 | * The constructor. |
|
32 | */ |
|
33 | public function __construct() |
|
34 | { |
|
35 | parent::__construct(); |
|
36 | ||
37 | $this->setStubDirectory(__DIR__.'/../stubs'); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * Get the default namespace for the class. |
|
42 | * |
|
43 | * @return string |
|
44 | */ |
|
45 | protected function getDefaultNamespace() |
|
46 | { |
|
47 | return $this->getRootNamespace().'\\'.($this->onAddon() ? 'Seeds' : 'Database\\Seeds'); |
|
48 | } |
|
49 | } |
|
50 |