| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function generate(Module $module) |
||
| 12 | { |
||
| 13 | $this->setModule($module); |
||
| 14 | |||
| 15 | $migrationTemplate = $this->buildTemplate('Migration', [ |
||
| 16 | '{{modelName}}' => $module->getModelName(), |
||
| 17 | '{{modelNamePlural}}' => $module->getModelNamePlural(), |
||
| 18 | '{{moduleName}}' => $module->getModuleName(), |
||
| 19 | '{{modelTableSchema}}' => $this->getSchema() |
||
| 20 | ]); |
||
| 21 | |||
| 22 | $dateSuffix = (int)date('His') + ++self::$counter; |
||
| 23 | file_put_contents(database_path() . "/migrations/" . date('Y_m_d_') . $dateSuffix . "_create_" . $module->getModuleName() . "_table.php", $migrationTemplate); |
||
| 24 | } |
||
| 45 |