Created
January 20, 2024 08:47
-
-
Save bay007/1bc5ab35050b213bcd97208435d8b9fa to your computer and use it in GitHub Desktop.
Check database php connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
\DB::connection()->getPDO(); | |
echo \DB::connection()->getDatabaseName(); | |
} catch (\Exception $e) { | |
echo 'None'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment