Skip to content

Commit

Permalink
fix: Migration Generator - disabled timestamps fix (#1071)
Browse files Browse the repository at this point in the history
* fix: Migration Generator - null  or null  fix

* fix to dashedPlural in routes blade scaffold template

---------

Co-authored-by: Billy Smithers <Billy.Smithers@skybettingandgaming.com>
  • Loading branch information
billysmithers and billyskybettingandgaming authored Jan 4, 2024
1 parent b13c1c3 commit 39b52bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Generators/MigrationGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function generateFields(): string
}
}

if ($createdAtField->name === 'created_at' and $updatedAtField->name === 'updated_at') {
if ($createdAtField->name ?? '' === 'created_at' and $updatedAtField->name ?? '' === 'updated_at') {
$fields[] = '$table->timestamps();';
} else {
if ($createdAtField) {
Expand Down
2 changes: 1 addition & 1 deletion views/scaffold/routes.blade.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Route::resource('{{ $config->prefixes->getRoutePrefixWith('/') }}{{ $config->modelNames->dashedPlural }}', {{ $config->namespaces->controller }}\{{ $config->modelNames->name }}Controller::class)@if(!$config->prefixes->route);@endif
@if($config->prefixes->route){!! infy_nl_tab().'->names(['.infy_nl_tab(1, 2).implode(','.infy_nl_tab(1, 2), create_resource_route_names($config->prefixes->getRoutePrefixWith('.').$config->modelNames->camelPlural, true)).infy_nl_tab().']);' !!}@endif
@if($config->prefixes->route){!! infy_nl_tab().'->names(['.infy_nl_tab(1, 2).implode(','.infy_nl_tab(1, 2), create_resource_route_names($config->prefixes->getRoutePrefixWith('.').$config->modelNames->dashedPlural, true)).infy_nl_tab().']);' !!}@endif

0 comments on commit 39b52bd

Please sign in to comment.