Skip to content

Commit 836b3c4

Browse files
authored
Update Schema.php
1 parent 605a48f commit 836b3c4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Data/Schema.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
namespace Bekwoh\LaravelDbDoc\Data;
44

5-
use Illuminate\Support\Collection;
6-
75
class 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)

0 commit comments

Comments
 (0)