mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:44:28 -04:00
CRUD
This commit is contained in:
parent
4aa087784c
commit
ee2e028782
@ -117,9 +117,18 @@ class MakeClass extends GeneratorCommand
|
|||||||
$str = '';
|
$str = '';
|
||||||
|
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$field = explode(':', $field)[0];
|
if ( ! $field) {
|
||||||
$str .= '{!! Former::text(\''. $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;
|
return $str;
|
||||||
|
@ -50,7 +50,7 @@ class MakeModule extends Command
|
|||||||
}, $fillable);
|
}, $fillable);
|
||||||
$fillable = join(',', $fillable);
|
$fillable = join(',', $fillable);
|
||||||
|
|
||||||
$this->info("Creating module: {$name}");
|
$this->info("Creating module: {$name}...");
|
||||||
|
|
||||||
Artisan::call('module:make', ['name' => [$name]]);
|
Artisan::call('module:make', ['name' => [$name]]);
|
||||||
Artisan::call('module:make-migration', ['name' => "create_{$lower}_table", '--fields' => $fields, 'module' => $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');
|
Artisan::call('module:dump');
|
||||||
|
|
||||||
|
$this->info("Done");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getArguments()
|
protected function getArguments()
|
||||||
|
@ -19,7 +19,7 @@ class $CLASS$Datatable extends EntityDatatable
|
|||||||
[
|
[
|
||||||
'created_at',
|
'created_at',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return Utils::timestampToDateString(strtotime($model->created_at));
|
return Utils::fromSqlDateTime($model->created_at);
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user