1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00
This commit is contained in:
Hillel Coren 2016-12-09 13:38:11 +02:00
parent 4aa087784c
commit ee2e028782
3 changed files with 16 additions and 5 deletions

View File

@ -117,9 +117,18 @@ class MakeClass extends GeneratorCommand
$str = '';
foreach ($fields as $field) {
$field = explode(':', $field)[0];
$str .= '{!! Former::text(\''. $field . '\') !!}
';
if ( ! $field) {
continue;
}
$parts = explode(':', $field);
$field = $parts[0];
$type = $parts[1];
if ($type == 'text') {
$str .= "{!! Former::textarea('" . $field . "') !!}\n";
} else {
$str .= "{!! Former::text('" . $field . "') !!}\n";
}
}
return $str;

View File

@ -50,7 +50,7 @@ class MakeModule extends Command
}, $fillable);
$fillable = join(',', $fillable);
$this->info("Creating module: {$name}");
$this->info("Creating module: {$name}...");
Artisan::call('module:make', ['name' => [$name]]);
Artisan::call('module:make-migration', ['name' => "create_{$lower}_table", '--fields' => $fields, 'module' => $name]);
@ -76,6 +76,8 @@ class MakeModule extends Command
}
Artisan::call('module:dump');
$this->info("Done");
}
protected function getArguments()

View File

@ -19,7 +19,7 @@ class $CLASS$Datatable extends EntityDatatable
[
'created_at',
function ($model) {
return Utils::timestampToDateString(strtotime($model->created_at));
return Utils::fromSqlDateTime($model->created_at);
}
],
];