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 2
2
3
3
namespace Bekwoh \LaravelDbDoc \Data ;
4
4
5
- use Illuminate \Support \Collection ;
6
-
7
5
class Schema
8
6
{
9
- protected Collection $ collections ;
7
+ protected array $ collections ;
10
8
11
9
public function __construct (protected $ tables , protected $ schema )
12
10
{
@@ -22,7 +20,7 @@ public function getData()
22
20
$ tables = $ this ->tables ;
23
21
$ schema = $ this ->schema ;
24
22
25
- $ this ->collections = collect () ;
23
+ $ this ->collections = [] ;
26
24
foreach ($ tables as $ table ) {
27
25
$ columns = $ schema ->listTableColumns ($ table );
28
26
$ foreignKeys = collect ($ schema ->listTableForeignKeys ($ table ))->keyBy (function ($ foreignColumn ) {
@@ -45,11 +43,12 @@ public function getData()
45
43
$ details ['default ' ] = $ this ->getDefaultValue ($ column );
46
44
$ details ['nullable ' ] = $ this ->getExpression (true === ! $ column ->getNotNull ());
47
45
$ details ['comment ' ] = $ column ->getComment ();
46
+
48
47
$ this ->collections [$ table ][] = $ details ;
49
48
}
50
49
}
51
50
52
- return $ this ->collections -> toArray () ;
51
+ return $ this ->collections ;
53
52
}
54
53
55
54
private function determineUnsigned ($ column )
You can’t perform that action at this time.
0 commit comments