'collection']); $user = User::factory()->create(); $matching = Hunts::factory()->create([ 'title' => 'Chasse au tresor de Bordeaux', 'description' => 'Une aventure urbaine', ]); $nonMatching = Hunts::factory()->create([ 'title' => 'Parcours decouverte Lyon', 'description' => 'Balade tranquille', ]); $response = $this->actingAs($user, 'sanctum') ->getJson("/api/hunts?{$param}=tresor"); $response->assertOk(); $huntIds = collect($response->json('data'))->pluck('id')->all(); expect($huntIds) ->toContain($matching->id) ->not->toContain($nonMatching->id); })->with([ 'search' => 'search', 'q' => 'q', ]);