1 | <?php |
||
2 | |||
3 | namespace LaraGeoData\Console\Commands; |
||
4 | |||
5 | use Illuminate\Console\Command; |
||
6 | use Illuminate\Filesystem\Filesystem; |
||
7 | |||
8 | class MakeMigrationCommand extends Command |
||
9 | { |
||
10 | use HasTablesClassesMap, HasSuffixOption; |
||
11 | |||
12 | /** |
||
13 | * The name and signature of the console command. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $signature = 'geonames:make:migration |
||
18 | {type : Migration type. } |
||
19 | {--suffix= : Suffix used for specify country if need. } |
||
20 | '; |
||
21 | |||
22 | /** |
||
23 | * The console command description. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $description = 'Publish specific migrations.'; |
||
28 | |||
29 | /** |
||
30 | * The filesystem instance. |
||
31 | * |
||
32 | * @var Filesystem |
||
33 | */ |
||
34 | protected Filesystem $files; |
||
35 | |||
36 | /** |
||
37 | * Create a new command instance. |
||
38 | * |
||
39 | * @param Filesystem $files |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | 18 | public function __construct(Filesystem $files) |
|
44 | { |
||
45 | 18 | parent::__construct(); |
|
46 | |||
47 | 18 | $this->files = $files; |
|
48 | 18 | } |
|
49 | |||
50 | 11 | public function handle() |
|
51 | { |
||
52 | 11 | $this->makeTableObjectNameByType($this->argument('type'), $this->files) |
|
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
53 | 11 | ->makeMigration($this->getSuffix()); |
|
54 | |||
55 | 11 | return 0; |
|
56 | } |
||
57 | } |
||
58 |