login()->loginNami(); auth()->user()->update(['firstname' => 'Jane', 'lastname' => 'Doe']); User::factory()->create(['firstname' => 'John', 'lastname' => 'Doe']); $anna = User::factory()->create(['firstname' => 'Anna', 'lastname' => 'Doe']); $this->get(route('api.user.index')) ->assertJsonPath('data.0.firstname', 'Anna') ->assertJsonPath('data.0.lastname', 'Doe') ->assertJsonPath('data.0.id', $anna->id) ->assertJsonPath('data.1.firstname', 'Jane') ->assertJsonPath('data.2.firstname', 'John'); } }