mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-23 13:51:13 +01:00
Enhance output message of 2fauth:check-db-connection command
This commit is contained in:
parent
30004bad13
commit
08c54328ca
@ -36,14 +36,16 @@ public function __construct()
|
||||
*/
|
||||
public function handle() : int
|
||||
{
|
||||
$this->line('This will return the name of the connected database, otherwise false');
|
||||
$this->newLine();
|
||||
|
||||
try {
|
||||
DB::connection()->getPDO();
|
||||
$this->line(DB::connection()->getDatabaseName());
|
||||
$this->info('Currently connected to ' . DB::connection()->getDriverName() . ' db "' . DB::connection()->getDatabaseName() . '"');
|
||||
|
||||
return 1;
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Cannot connect to ' . DB::connection()->getDriverName() . ' db "' . DB::connection()->getDatabaseName() . '"');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user