create(); $tenant2 = Tenant::factory()->create(); $user = User::factory()->for($tenant1)->create(); actingAs($user); $license = License::create([ 'type' => 'per_student', 'tenant_id' => $tenant2->id, // attempt cross-tenant write ]); expect($license->tenant_id)->toBe($tenant1->id); });