Skip to content

Commit

Permalink
feat:模板新增date,created_at 类型使用\Illuminate\Support\Carbon
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjy committed Feb 1, 2024
1 parent 442d3ef commit 75c5474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Generators/Model/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function generateProperties(array $columns)
if (str_contains($column['type_name'], 'int')) {
$type = 'int';
} elseif ($column['name'] == 'created_at' || $column['name'] == 'updated_at') {
$type = '\Carbon\Carbon';
$type = '\Illuminate\Support\Carbon';
} else {
$type = 'string';
}
Expand Down
3 changes: 3 additions & 0 deletions src/Generators/Model/default/model.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
echo "<?php\n";
?>
/**
* @date: <?= date('Y-m-d H:i:s') . "\n" ?>
*/

namespace <?= $generator->ns ?>;

Expand Down

0 comments on commit 75c5474

Please sign in to comment.