vendredi 13 mai 2016

How to test if connection is ok in laravel?

I tried

if (DB::connection()) { 
    //
}

but this produces error :

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

I want to test from code if everything is fine with connection but without errors, I am looking for solution without try catch.....



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire