29 lines
642 B
PHP
Raw Normal View History

2024-12-22 07:46:20 +08:00
<?php
namespace Modules\Common\Repository\Options;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
class Schemas implements OptionInterface
{
public function get(): array
{
$options = [];
$tablePrefix = DB::connection()->getTablePrefix();
foreach (Schema::getTables() as $table) {
$tableName = Str::of($table['name'])->remove($tablePrefix);
$options[] = [
'label' => $tableName . "\t\t\t\t" . $table['comment'],
'value' => $tableName,
];
}
return $options;
}
}