Skip to content

Commit

Permalink
fix connection name and table size
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Aug 15, 2024
1 parent 837e018 commit 15513c4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Illuminate/Database/Console/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected function displayForCli(array $data)
$this->newLine();

$this->components->twoColumnDetail('<fg=green;options=bold>'.$platform['name'].'</>', $platform['version']);
$this->components->twoColumnDetail('Connection', Arr::get($platform['config'], 'connection'));
$this->components->twoColumnDetail('Connection', $platform['connection']);
$this->components->twoColumnDetail('Database', Arr::get($platform['config'], 'database'));
$this->components->twoColumnDetail('Host', Arr::get($platform['config'], 'host'));
$this->components->twoColumnDetail('Port', Arr::get($platform['config'], 'port'));
Expand All @@ -186,13 +186,11 @@ protected function displayForCli(array $data)
);

$tables->each(function ($table) {
if ($tableSize = $table['size']) {
$tableSize = Number::fileSize($tableSize, 2);
}
$tableSize = is_null($table['size']) ? null : Number::fileSize($table['size'], 2);

$this->components->twoColumnDetail(
($table['schema'] ? $table['schema'].' <fg=gray;options=bold>/</> ' : '').$table['table'].($this->output->isVerbose() ? ' <fg=gray>'.$table['engine'].'</>' : null),
($tableSize ?: '').($this->option('counts') ? ' <fg=gray;options=bold>/</> <fg=yellow;options=bold>'.Number::format($table['rows']).'</>' : '')
($tableSize ?? '').($this->option('counts') ? ' <fg=gray;options=bold>/</> <fg=yellow;options=bold>'.Number::format($table['rows']).'</>' : '')
);

if ($this->output->isVerbose()) {
Expand Down

0 comments on commit 15513c4

Please sign in to comment.