File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 22
33namespace Bekwoh \LaravelDbDoc \Data ;
44
5- use Illuminate \Support \Collection ;
6-
75class Schema
86{
9- protected Collection $ collections ;
7+ protected array $ collections ;
108
119 public function __construct (protected $ tables , protected $ schema )
1210 {
@@ -22,7 +20,7 @@ public function getData()
2220 $ tables = $ this ->tables ;
2321 $ schema = $ this ->schema ;
2422
25- $ this ->collections = collect () ;
23+ $ this ->collections = [] ;
2624 foreach ($ tables as $ table ) {
2725 $ columns = $ schema ->listTableColumns ($ table );
2826 $ foreignKeys = collect ($ schema ->listTableForeignKeys ($ table ))->keyBy (function ($ foreignColumn ) {
@@ -45,11 +43,12 @@ public function getData()
4543 $ details ['default ' ] = $ this ->getDefaultValue ($ column );
4644 $ details ['nullable ' ] = $ this ->getExpression (true === ! $ column ->getNotNull ());
4745 $ details ['comment ' ] = $ column ->getComment ();
46+
4847 $ this ->collections [$ table ][] = $ details ;
4948 }
5049 }
5150
52- return $ this ->collections -> toArray () ;
51+ return $ this ->collections ;
5352 }
5453
5554 private function determineUnsigned ($ column )
You can’t perform that action at this time.
0 commit comments