Skip to content

Conversation

@leolnid
Copy link
Contributor

@leolnid leolnid commented Nov 27, 2025

Normalize path separators in config file names

Adds normalization of path separators (/ and \) to dots (.) when registering package configurations.

Before: $this->mergeConfigFrom($vendorConfig, $configFileName);
After: $this->mergeConfigFrom($vendorConfig, str_replace(['/', '\\'], '.', $configFileName));

This ensures config file names with path separators (e.g., subfolder/config) are properly converted to dot notation (subfolder.config), which is required for Laravel config keys.

Benefits:

  • ✅ Supports nested config files (e.g., subfolder/config)
  • ✅ Cross-platform compatibility (handles both / and \)
  • ✅ Maintains backward compatibility with simple file names

@freekmurze
Copy link
Member

The tests are failing. Could you take a look?

Normalize path separators to dots for config keys and to DIRECTORY_SEPARATOR for file paths when registering and publishing config files. This enables support for nested config files (e.g., `subfolder/config`) and improves cross-platform compatibility.
Apply path normalization (DIRECTORY_SEPARATOR) when locating config files in the filesystem, ensuring cross-platform compatibility for nested config files.
@leolnid
Copy link
Contributor Author

leolnid commented Dec 3, 2025

The failing tests appear unrelated to this PR. Only ProcessConfigs.php was modified for config path normalization, with no changes to Blade components, view registration, or test infrastructure.

Failures:

  1. Blade component test: No hint path defined for [__components] - occurs only on CI with prefer-lowest
  2. TestCase error: Access to undeclared static property ... $latestResponse - appears to be a testbench compatibility issue with minimum versions

Both errors occur only on CI with prefer-lowest dependencies, suggesting compatibility issues with minimum Laravel/testbench versions or pre-existing conditions. The config normalization changes are isolated and shouldn't affect these areas.

Could someone help investigate if these are dependency version issues or pre-existing problems?

@freekmurze
Copy link
Member

I'll already merge this in

@freekmurze freekmurze merged commit 0046de5 into spatie:main Dec 4, 2025
37 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants