File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ public function into(
70
70
array $ formatOptions = [],
71
71
?string $ when = null ,
72
72
): static {
73
- if (empty ( $ columns) ) {
74
- $ columns = $ this ->buildDefaultColumns ($ table , $ columns );
73
+ if (! $ columns && $ this -> defaultColumns ) {
74
+ $ columns = $ this ->createColumnsFromHeaders ($ table , $ this -> defaultColumns );
75
75
}
76
76
77
77
if (! $ formatOptions ) {
@@ -90,9 +90,9 @@ public function into(
90
90
return $ this ;
91
91
}
92
92
93
- protected function buildDefaultColumns (string $ table , array $ columns ): array
93
+ public function createColumnsFromHeaders (string $ table , array $ columns ): array
94
94
{
95
- $ columns = array_map ('strtolower ' , $ this -> defaultColumns );
95
+ $ columns = array_map ('strtolower ' , $ columns );
96
96
$ schemaColumns = collect (Schema::connection (config ('sql-loader.connection ' ))->getColumns ($ table ));
97
97
98
98
$ dates = $ schemaColumns ->filter (fn ($ column ) => in_array ($ column ['type ' ], [
You can’t perform that action at this time.
0 commit comments