diff --git a/app/Console/Commands/MakeClass.php b/app/Console/Commands/MakeClass.php index 142b1035d193..be14f278c3a2 100644 --- a/app/Console/Commands/MakeClass.php +++ b/app/Console/Commands/MakeClass.php @@ -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; diff --git a/app/Console/Commands/MakeModule.php b/app/Console/Commands/MakeModule.php index 25fca1d74f45..e290ddf8db8c 100644 --- a/app/Console/Commands/MakeModule.php +++ b/app/Console/Commands/MakeModule.php @@ -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() diff --git a/app/Console/Commands/stubs/datatable.stub b/app/Console/Commands/stubs/datatable.stub index f88f4c21f7e6..f9983b806e14 100644 --- a/app/Console/Commands/stubs/datatable.stub +++ b/app/Console/Commands/stubs/datatable.stub @@ -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); } ], ];