'collection']); app(EngineManager::class)->forgetEngines(); $user = User::factory()->create(); $hunt = Hunts::withoutSyncingToSearch(fn () => Hunts::factory()->create([ 'title' => 'Treasure hunt', ])); HuntSteps::factory()->create([ 'hunt_id' => $hunt->id, 'xp' => 125, ]); HuntSteps::factory()->create([ 'hunt_id' => $hunt->id, 'xp' => 75, ]); $response = $this ->actingAs($user, 'sanctum') ->getJson('/api/hunts'); $response ->assertOk() ->assertJsonPath('data.0.id', $hunt->id) ->assertJsonPath('data.0.xp', 200) ->assertJsonMissingPath('data.0.steps_sum_xp'); });