comparison src/Generator/Generator.php @ 45:c7fd31303024 default tip

merging down to default
author Luka Sitas <sitas.luka.97@gmail.com>
date Thu, 12 Nov 2026 21:19:53 -0500
parents c062f013fd19
children
comparison
equal deleted inserted replaced
34:f65ab84ee47f 45:c7fd31303024
39 39
40 /* $this->setCurrentTable($this->getTableInput()); */ 40 /* $this->setCurrentTable($this->getTableInput()); */
41 /* dd($this->getCurrentTable()->getForeignKeys()); */ 41 /* dd($this->getCurrentTable()->getForeignKeys()); */
42 42
43 if ($this->option('all')) { 43 if ($this->option('all')) {
44 /* $this->input->setOption('factory', true); */ 44 $this->input->setOption('factory', true);
45 /* $this->input->setOption('seed', true); */ 45 /* $this->input->setOption('seed', true); */
46 /* $this->input->setOption('migration', true); */ 46 /* $this->input->setOption('migration', true); */
47 $this->input->setOption('controller', true); 47 $this->input->setOption('controller', true);
48 $this->input->setOption('model', true); 48 $this->input->setOption('model', true);
49 $this->input->setOption('request', true); 49 $this->input->setOption('request', true);
50 $this->input->setOption('view', true); 50 $this->input->setOption('view', true);
51 $this->input->setOption('route', true); 51 $this->input->setOption('route', true);
52 $this->input->setOption('test', true);
52 } 53 }
53 54
54 /* if ($this->option('factory')) { */ 55 if ($this->option('factory')) {
55 /* $this->createFactory(); */ 56 $this->createFactory();
56 /* } */ 57 }
57 58
58 /* if ($this->option('migration')) { */ 59 /* if ($this->option('migration')) { */
59 /* $this->createMigration(); */ 60 /* $this->createMigration(); */
60 /* } */ 61 /* } */
61 62
80 } 81 }
81 82
82 if ($this->option('route')) { 83 if ($this->option('route')) {
83 $this->createRoute(); 84 $this->createRoute();
84 } 85 }
86
87 if ($this->option('test')) {
88 $this->createTest();
89 }
85 } 90 }
86 91
87 /** 92 /**
88 * Get the console command options. 93 * Get the console command options.
89 */ 94 */
94 ['controller', 'c', InputOption::VALUE_NONE, 'Generate a controller class for the table.'], 99 ['controller', 'c', InputOption::VALUE_NONE, 'Generate a controller class for the table.'],
95 ['model', 'm', InputOption::VALUE_NONE, 'Generate a model class for the table.'], 100 ['model', 'm', InputOption::VALUE_NONE, 'Generate a model class for the table.'],
96 ['request', 'r', InputOption::VALUE_NONE, 'Generate base request classes for the table.'], 101 ['request', 'r', InputOption::VALUE_NONE, 'Generate base request classes for the table.'],
97 ['view', '', InputOption::VALUE_NONE, 'Generate base views for the table.'], 102 ['view', '', InputOption::VALUE_NONE, 'Generate base views for the table.'],
98 ['route', 'w', InputOption::VALUE_NONE, 'Generate base routes classes for the table.'], 103 ['route', 'w', InputOption::VALUE_NONE, 'Generate base routes classes for the table.'],
104 ['factory', 'F', InputOption::VALUE_NONE, 'Generate base factory classes for the table.'],
105 ['test', 't', InputOption::VALUE_NONE, 'Generate base test classes for the table.'],
99 ]); 106 ]);
100 } 107 }
101 108
102 /** 109 /**
103 * Interact further with the user if they were prompted for missing arguments. 110 * Interact further with the user if they were prompted for missing arguments.
128 135
129 protected function createRoute() 136 protected function createRoute()
130 { 137 {
131 $this->call('mf:route', ['table' => $this->getTableInput(), '--fresh' => $this->option('fresh')]); 138 $this->call('mf:route', ['table' => $this->getTableInput(), '--fresh' => $this->option('fresh')]);
132 } 139 }
140
141 protected function createFactory()
142 {
143 $this->call('mf:factory', ['table' => $this->getTableInput(), '--fresh' => $this->option('fresh')]);
144 }
145
146 protected function createTest()
147 {
148 $this->call('mf:test', ['table' => $this->getTableInput(), '--fresh' => $this->option('fresh')]);
149 }
133 } 150 }