create(); $user = User::factory()->create(); WorkspaceSetting::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'domain' => 'ai', 'key' => 'policy_mode', 'value' => 'private_only', 'updated_by_user_id' => null, ]); session()->put(WorkspaceContext::SESSION_KEY, (int) $workspace->getKey()); $this->actingAs($user) ->get(WorkspaceSettings::getUrl(panel: 'admin')) ->assertNotFound(); Livewire::actingAs($user) ->test(WorkspaceSettings::class) ->assertStatus(404); });