create(); $otherTenant = Tenant::factory()->create(); InventoryItem::factory()->create([ 'tenant_id' => $tenant->getKey(), 'display_name' => 'Item A', 'policy_type' => 'deviceConfiguration', 'external_id' => 'item-a', 'platform' => 'windows', ]); InventoryItem::factory()->create([ 'tenant_id' => $otherTenant->getKey(), 'display_name' => 'Item B', 'policy_type' => 'deviceConfiguration', 'external_id' => 'item-b', 'platform' => 'windows', ]); $user = User::factory()->create(); $user->tenants()->syncWithoutDetaching([ $tenant->getKey() => ['role' => 'owner'], $otherTenant->getKey() => ['role' => 'owner'], ]); $this->actingAs($user) ->get(InventoryItemResource::getUrl('index', tenant: $tenant)) ->assertOk() ->assertSee('Item A') ->assertDontSee('Item B'); });