I am trying to check if a database is connected in Laravel.
I\'ve looked around the documentation and can\'t find anything. The closest thing I\'ve found is this, bu
You can use alexw's solution with the Artisan. Run following commands in the command line.
php artisan tinker DB::connection()->getPdo();
If connection is OK, you should see
CONNECTION_STATUS: "Connection OK; waiting to send.",
near the end of the response.