mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
CRUD
This commit is contained in:
parent
4aa087784c
commit
ee2e028782
@ -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;
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
}
|
||||
],
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user