File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,26 @@ public function getColumnListing($table)
47
47
{
48
48
$ sql = $ this ->grammar ->compileColumnExists ();
49
49
$ database = $ this ->connection ->getDatabaseName ();
50
- $ table = $ this ->connection ->getTablePrefix ().$ table ;
51
- $ results = $ this ->connection ->select ($ sql , [$ database , $ table ]);
50
+ $ table = $ this ->connection ->getTablePrefix () . $ table ;
52
51
53
- return $ this ->connection ->getPostProcessor ()->processColumnListing ($ results );
52
+ $ tableExploded = explode ('. ' , $ table );
53
+
54
+ if (count ($ tableExploded ) > 1 ) {
55
+ $ database = $ tableExploded [0 ];
56
+ $ table = $ tableExploded [1 ];
57
+ }
58
+
59
+ $ results = $ this ->connection ->select ($ sql , [
60
+ $ database ,
61
+ $ table ,
62
+ ]);
63
+
64
+ $ res = $ this ->connection ->getPostProcessor ()
65
+ ->processColumnListing ($ results );
66
+
67
+ return array_values (array_map (function ($ r ) {
68
+ return $ r ->column_name ;
69
+ }, $ res ));
54
70
}
55
71
56
72
/**
You can’t perform that action at this time.
0 commit comments