I have enabled sqlsrv and postgree extensions
Default connection is sqlsrv
.env configs
DB_CONNECTION=sqlsrv
DB_HOST=00.00.000.000
DB_PORT=1433
DB_DATABASE=DBNAME
DB_USERNAME=USER
DB_PASSWORD=5555555
Wrote following code for just checking is it working but the code thrown an error "could not find the driver"
Route::get('/',function (){
dd(DB::connection()->getPdo());
try {
DB::connection()->getPdo();
if(DB::connection()->getDatabaseName()){
echo "Yes! Successfully connected to the DB: " . DB::connection()->getDatabaseName();
}
} catch (\Exception $e) {
die("Could not connect to the database. Please check your configuration.");
}
});
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qB3muC
via IFTTT
Aucun commentaire:
Enregistrer un commentaire