diff --git a/src/GraphBuilder.php b/src/GraphBuilder.php index 765c184..f311c65 100644 --- a/src/GraphBuilder.php +++ b/src/GraphBuilder.php @@ -17,7 +17,7 @@ class GraphBuilder * @param $models * @return Graph */ - public function buildGraph(Collection $models) : Graph + public function buildGraph(Collection $models): Graph { $this->graph = new Graph(); @@ -32,40 +32,23 @@ public function buildGraph(Collection $models) : Graph protected function getTableColumnsFromModel(EloquentModel $model) { - try { - - $table = $model->getConnection()->getTablePrefix() . $model->getTable(); - $schema = $model->getConnection()->getDoctrineSchemaManager($table); - $databasePlatform = $schema->getDatabasePlatform(); - $databasePlatform->registerDoctrineTypeMapping('enum', 'string'); - - $database = null; - - if (strpos($table, '.')) { - list($database, $table) = explode('.', $table); - } - - return $schema->listTableColumns($table, $database); - } catch (\Throwable $e) { - } - - return []; + return \Schema::getColumns($model->getTable()); } protected function getModelLabel(EloquentModel $model, string $label) { $table = '<
' . $label . ' |
' . $label . ' |
' . $label . ' |
' . $label . ' |