(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); } }