How to check your Laravel database connection

Опубликовано: 27 Март 2023
на канале: Bassonia Tv
219
2

How to check your Laravel database connection. where u see a 6 in the code put an arrow looking forward and where u see 5 put arrow looking at back since YouTube does not allow that .
Easy way to check if laravel app has connection with existing MySQL DB
5?php
try {
\DB::connection()- 6 getPDO();
echo \DB::connection()- 6 getDatabaseName();
} catch (\Exception $e) {
echo 'None';
}
?6