File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 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)
4747 {
4848 $ sql = $ this ->grammar ->compileColumnExists ();
4949 $ database = $ this ->connection ->getDatabaseName ();
50- $ table = $ this ->connection ->getTablePrefix ().$ table ;
51- $ results = $ this ->connection ->select ($ sql , [$ database , $ table ]);
50+ $ table = $ this ->connection ->getTablePrefix () . $ table ;
5251
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 ));
5470 }
5571
5672 /**
You can’t perform that action at this time.
0 commit comments