From c2a82184c207fc51e458150f6b799eef35620de6 Mon Sep 17 00:00:00 2001 From: Miftahurrahmi Date: Mon, 3 Jun 2024 17:03:09 +0700 Subject: [PATCH] trying fix schema class --- src/Controllers/BadasoTableController.php | 3 +-- src/Database/Schema/SchemaManager.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Controllers/BadasoTableController.php b/src/Controllers/BadasoTableController.php index 5f62001a..c3a40893 100644 --- a/src/Controllers/BadasoTableController.php +++ b/src/Controllers/BadasoTableController.php @@ -47,11 +47,10 @@ public function read(Request $request) $request->validate([ 'table' => 'required', ]); - $table = $request->table; $table_fields = SchemaManager::describeTable($table); + // $table_fields = Schema::getIndexes($table); - // dd($table_fields); $fields = []; foreach ($table_fields as $key => $column) { $column = collect($column)->toArray(); diff --git a/src/Database/Schema/SchemaManager.php b/src/Database/Schema/SchemaManager.php index 272ef15b..7a579015 100644 --- a/src/Database/Schema/SchemaManager.php +++ b/src/Database/Schema/SchemaManager.php @@ -20,7 +20,7 @@ public static function __callStatic($method, $args) public static function manager() { // return Schema::connection(); - // return DB::connection()->getDoctrineSchemaManager(); + return DB::connection()->getDoctrineSchemaManager(); } public static function getDatabaseConnection() @@ -76,7 +76,7 @@ public static function listTableDetails($table_name) */ public static function describeTable($table_name) { - Type::registerCustomPlatformTypes(); + // Type::registerCustomPlatformTypes(); $table = static::listTableDetails($table_name);