-
Notifications
You must be signed in to change notification settings - Fork 4
refactor!: Rename LaravelConfig to ConfigManager (v6.0.0) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BREAKING CHANGE: The main class has been renamed from LaravelConfig to ConfigManager to prevent confusion with the facade. This addresses the issue where IDEs would auto-import the class (TarfinLabs\LaravelConfig\LaravelConfig) instead of the facade, causing "non-static method called statically" errors.
Update the singleton binding to use the renamed ConfigManager class.
Update the LaravelConfig alias to point to the new facade location at TarfinLabs\LaravelConfig\Facades\LaravelConfig.
- Update import statement to ConfigManager - Update property type hint to ConfigManager - Update instantiation to use ConfigManager
- Add test for container binding resolution to ConfigManager - Add test for singleton behavior - Add tests for helper functions: read_config, has_config, create_config, set_config_value
Document breaking changes: - LaravelConfig class renamed to ConfigManager - Facade moved to Facades directory - Include migration guide for direct class importers
Allow tests to use the default database connection from phpunit.xml.dist instead of hardcoding mysql.
- Add PHP 8.5 to test matrix - Remove Laravel 8 from matrix (security vulnerabilities) - Add proper exclusions for PHP/Laravel version compatibility: - PHP 8.1 doesn't support Laravel 11+ (requires PHP 8.2+) - PHP 8.5 only tests with Laravel 12 - Update composer.json to drop Laravel 8 support - Update CHANGELOG with breaking changes
- Remove Laravel 8/9 from illuminate/support constraint - Remove orchestra/testbench ^7.0 (Laravel 9 specific) - Update GitHub Actions workflow matrix - Add PHP 8.5 support to CI matrix - Update CHANGELOG to reflect breaking changes
- Update phpunit.xml.dist to modern format (remove deprecated attributes) - Convert test methods from @test annotation to test_ prefix convention - Add .phpunit.cache to .gitignore
Switch to modern PHPUnit attribute-based test discovery for cleaner test method names and better IDE support.
- Replace legacy factory with modern class-based ConfigFactory - Add HasFactory trait to Config model - Remove laravel/legacy-factories dependency - Remove factory publishing (now auto-loaded from package) - Update tests to use modern Config::factory() syntax - Update CHANGELOG with migration guide
MrKacmaz
approved these changes
Dec 23, 2025
Resolved conflicts preferring v6 changes: - tests.yml: Keep PHP 8.5 support and v6 exclude rules - composer.json: Keep v6 require-dev versions - phpunit.xml.dist: Keep cacheDirectory attribute
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a major version release (v6.0.0) that renames the main
LaravelConfigclass toConfigManagerand restructures the facade to follow Laravel conventions.Problem
IDEs auto-import
TarfinLabs\LaravelConfig\LaravelConfig(the class) instead of the facade when developers typeLaravelConfig::. This causes "non-static method called statically" errors that are confusing and time-consuming to debug.Solution
LaravelConfigclass toConfigManagerto prevent confusionFacades/LaravelConfigfollowing Laravel's naming conventionLaravelConfig, so existing code using the facade continues to workBreaking Changes
use LaravelConfig;(alias)read_config(),has_config()etc.app('laravel-config')new LaravelConfig()new ConfigManager()use TarfinLabs\LaravelConfig\LaravelConfigChanges
Files Renamed/Moved
src/LaravelConfig.php→src/ConfigManager.phpsrc/LaravelConfigFacade.php→src/Facades/LaravelConfig.phpUpdated Files
src/LaravelConfigServiceProvider.php- Uses ConfigManagercomposer.json- Updated facade alias path, added PHP 8.5 supporttests/LaravelConfigTest.php- Updated to use ConfigManagerCHANGELOG.md- Added v6.0.0 entry with migration guideNew Tests
Migration Guide
If you were directly importing the
LaravelConfigclass:If you were using the facade or helper functions, no changes are required.
Test Plan