Add mobile and desktop search for Events.
Deploy Ladill Events / deploy (push) Successful in 29s

Introduce a dedicated /search page, wire the bottom nav and topbar to it, and expose JSON results for live lookup of events and programmes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 15:37:44 +00:00
co-authored by Cursor
parent 88e5276e68
commit 849617da85
9 changed files with 307 additions and 58 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
namespace Tests\Feature;
use App\Models\QrCode;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Str;
use Tests\TestCase;
class SearchTest extends TestCase
{
use RefreshDatabase;
private function user(): User
{
return User::create(['public_id' => (string) Str::uuid(), 'name' => 'A', 'email' => 'a+'.uniqid().'@x.com']);
}
public function test_user_can_search_owned_event_by_label(): void
{
$user = $this->user();
QrCode::query()->create([
'user_id' => $user->id,
'short_code' => 'summit',
'type' => QrCode::TYPE_EVENT,
'label' => 'NextGen Summit',
'destination_url' => 'https://example.com',
'is_active' => true,
]);
$response = $this->actingAs($user)
->getJson(route('events.search', ['q' => 'NextGen']));
$response->assertOk();
$response->assertJsonPath('results.0.type', 'event');
$response->assertJsonPath('results.0.title', 'NextGen Summit');
}
public function test_search_page_renders_for_authenticated_user(): void
{
$user = $this->user();
$this->actingAs($user)
->get(route('events.search'))
->assertOk()
->assertSee('Find events and programmes', false);
}
}