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(
7070 array $ formatOptions = [],
7171 ?string $ when = null ,
7272 ): static {
73- if (empty ( $ columns) ) {
74- $ columns = $ this ->buildDefaultColumns ($ table , $ columns );
73+ if (! $ columns && $ this -> defaultColumns ) {
74+ $ columns = $ this ->createColumnsFromHeaders ($ table , $ this -> defaultColumns );
7575 }
7676
7777 if (! $ formatOptions ) {
@@ -90,9 +90,9 @@ public function into(
9090 return $ this ;
9191 }
9292
93- protected function buildDefaultColumns (string $ table , array $ columns ): array
93+ public function createColumnsFromHeaders (string $ table , array $ columns ): array
9494 {
95- $ columns = array_map ('strtolower ' , $ this -> defaultColumns );
95+ $ columns = array_map ('strtolower ' , $ columns );
9696 $ schemaColumns = collect (Schema::connection (config ('sql-loader.connection ' ))->getColumns ($ table ));
9797
9898 $ dates = $ schemaColumns ->filter (fn ($ column ) => in_array ($ column ['type ' ], [
You can’t perform that action at this time.
0 commit comments