| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function execute($request) |
||
| 19 | { |
||
| 20 | $model = ucfirst($request['name']); |
||
| 21 | $table = Str::plural(Str::snake($model)); |
||
| 22 | $stub = __DIR__ . '/../../../resources/stubs/migration/model.stub'; |
||
| 23 | $this->filename = 'database/migrations/' |
||
| 24 | . date('Y_m_d_His') |
||
| 25 | . "_create_{$table}_table.php"; |
||
| 26 | |||
| 27 | (new StubWriter(base_path($this->filename), $stub))->write([ |
||
| 28 | '$classname$' => 'Create' . Str::plural($model) . 'Table', |
||
| 29 | '$columns$' => rtrim($this->getColumns($request)), |
||
| 30 | '$table$' => $table, |
||
| 31 | ]); |
||
| 32 | } |
||
| 33 | |||
| 51 |