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.");
}
});
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire