pgsql db connection and testing route added
This commit is contained in:
+21
-2
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Laravel\Fortify\Features;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
@@ -8,11 +9,29 @@ Route::get('/', function () {
|
||||
return view('welcome');
|
||||
})->name('home');
|
||||
|
||||
// Test Route für PGSQL - kann beliebig abgeändert werden (zum Testen)
|
||||
Route::get('/test-zweite-db', function () {
|
||||
try {
|
||||
// Eine einfache Abfrage auf der zweiten Verbindung
|
||||
$result = DB::connection('pgsql_second')->select('SELECT NOW() as current_time');
|
||||
return response()->json([
|
||||
'status' => 'Erfolgreich verbunden mit zweiter Datenbank',
|
||||
'zeitstempel' => $result[0]->current_time
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'status' => 'Fehler bei der Verbindung',
|
||||
'meldung' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Route::view('dashboard', 'dashboard')
|
||||
->middleware(['auth', 'verified'])
|
||||
->name('dashboard');
|
||||
|
||||
Route::view('company-search', 'company-search')
|
||||
Volt::route('company-search', 'company-search')
|
||||
->middleware(['auth', 'verified'])
|
||||
->name('company-search');
|
||||
|
||||
@@ -35,4 +54,4 @@ Route::middleware(['auth'])->group(function () {
|
||||
->name('two-factor.show');
|
||||
});
|
||||
|
||||
require __DIR__.'/auth.php';
|
||||
require __DIR__ . '/auth.php';
|
||||
|
||||
Reference in New Issue
Block a user