From 39b52bd49dcddd8e6a0ff11d72fe743a39d943fc Mon Sep 17 00:00:00 2001 From: Billy Smithers Date: Thu, 4 Jan 2024 04:05:23 +0000 Subject: [PATCH] fix: Migration Generator - disabled timestamps fix (#1071) * fix: Migration Generator - null or null fix * fix to dashedPlural in routes blade scaffold template --------- Co-authored-by: Billy Smithers --- src/Generators/MigrationGenerator.php | 2 +- views/scaffold/routes.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generators/MigrationGenerator.php b/src/Generators/MigrationGenerator.php index 7e489ad9c..8942223f1 100755 --- a/src/Generators/MigrationGenerator.php +++ b/src/Generators/MigrationGenerator.php @@ -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) { diff --git a/views/scaffold/routes.blade.php b/views/scaffold/routes.blade.php index 30a5fa0e5..6353e4d8a 100755 --- a/views/scaffold/routes.blade.php +++ b/views/scaffold/routes.blade.php @@ -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 \ No newline at end of file +@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 \ No newline at end of file