diff --git a/config/database.php b/config/database.php
index c676a91..58228ce 100644
--- a/config/database.php
+++ b/config/database.php
@@ -82,14 +82,13 @@ return [
]) : [],
],
- 'pgsql' => [
+ 'pgsql_second' => [
'driver' => 'pgsql',
- 'url' => env('DB_URL'),
- 'host' => env('DB_HOST', '127.0.0.1'),
- 'port' => env('DB_PORT', '5432'),
- 'database' => env('DB_DATABASE', 'laravel'),
- 'username' => env('DB_USERNAME', 'root'),
- 'password' => env('DB_PASSWORD', ''),
+ 'host' => env('DB_HOST2', '127.0.0.1'),
+ 'port' => env('DB_PORT2', '5433'),
+ 'database' => env('DB_DATABASE2', 'laravel'),
+ 'username' => env('DB_USERNAME2', 'root'),
+ 'password' => env('DB_PASSWORD2', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
@@ -147,7 +146,7 @@ return [
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
- 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
+ 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
'persistent' => env('REDIS_PERSISTENT', false),
],
diff --git a/resources/views/company-search.blade.php b/resources/views/company-search.blade.php
deleted file mode 100644
index 6e3da99..0000000
--- a/resources/views/company-search.blade.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- {{ __('Unternehmensauskunft') }}
- {{ __('Suchen Sie nach Unternehmensinformationen') }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/resources/views/livewire/company-search.blade.php b/resources/views/livewire/company-search.blade.php
index 0df8230..247cac0 100644
--- a/resources/views/livewire/company-search.blade.php
+++ b/resources/views/livewire/company-search.blade.php
@@ -24,9 +24,8 @@ new #[Layout('components.layouts.app')] class extends Component {
+ placeholder="{{ __('Unternehmen suchen....') }}"
+ class="w-full" />
@@ -40,4 +39,4 @@ new #[Layout('components.layouts.app')] class extends Component {
-
+
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index a9fb23a..ff67159 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,6 +1,7 @@
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';
diff --git a/tests/Feature/CompanySearchTest.php b/tests/Feature/CompanySearchTest.php
index 979c6f7..56e867d 100644
--- a/tests/Feature/CompanySearchTest.php
+++ b/tests/Feature/CompanySearchTest.php
@@ -1,6 +1,7 @@
get(route('company-search'));
@@ -8,10 +9,25 @@ test('guests are redirected to the login page', function () {
});
test('authenticated users can visit the company search page', function () {
- $user = User::factory()->create();
- $this->actingAs($user);
+ $this->actingAs(User::factory()->create());
+
+ $this->get(route('company-search'))->assertOk();
+});
+
+test('company search page displays correctly', function () {
+ $this->actingAs(User::factory()->create());
$response = $this->get(route('company-search'));
- $response->assertSuccessful();
+
$response->assertSee('Unternehmensauskunft');
+ $response->assertSee('Suchen Sie nach Unternehmensinformationen');
+});
+
+test('search input is wired to component', function () {
+ $this->actingAs(User::factory()->create());
+
+ Volt::test('company-search')
+ ->assertSet('search', '')
+ ->set('search', 'Test Firma')
+ ->assertSet('search', 'Test Firma');
});