microweber-packages / microweber-config
Standalone Laravel config package with per-environment file loading and runtime save support. Enables multi-site configurations by loading config files from environment-specific subdirectories.
Package info
github.com/microweber-packages/microweber-config
pkg:composer/microweber-packages/microweber-config
Requires
- php: ^8.1
- illuminate/config: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- microweber-packages/microweber-package: *
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.0|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
- microweber-packages/config: *
This package is auto-updated.
Last update: 2026-11-03 17:06:10 UTC
README
A standalone Laravel package that extends the default config repository with:
- Per-environment config loading – Loads config files from
config/{env}/directories, enabling multi-site support (e.g.,config/my-site.com/) - Runtime config saving – Persist config changes back to PHP files at runtime
- Relative path conversion – Automatically converts absolute
storage_path(),database_path(), andbase_path()references to portable helper calls when saving
Installation
composer require microweber-packages/microweber-config
The package auto-registers its service provider via Laravel's package discovery.
Usage
Per-environment config loading
Create a subdirectory in your config/ folder named after the environment:
config/
├── app.php # Base config
├── database.php # Base config
└── my-site.com/ # Environment-specific overrides
├── app.php
└── database.php
When your app runs with --env=my-site.com, the files in config/my-site.com/ override the base config.
Saving config at runtime
use Illuminate\Support\Facades\Config; Config::set('microweber.site_name', 'My Site'); Config::save(['microweber']);
Multi-site detection
$config = app('config'); if ($config->isMultisite()) { // Environment directory was detected }
Testing
cd packages/microweber-config
composer install
vendor/bin/phpunit
License
MIT