Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel database connection check

use IlluminateSupportFacadesDB;

// Test database connection
try {
    DB::connection()->getPdo();
} catch (Exception $e) {
    die("Could not connect to the database.  Please check your configuration. error:" . $e );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #database #connection #check
ADD COMMENT
Topic
Name
8+2 =