https://github.com/phphe/laravel-custom-config
JUST one file! a simple middleware to load and save custom config.
https://github.com/phphe/laravel-custom-config
Last synced: 6 days ago
JSON representation
JUST one file! a simple middleware to load and save custom config.
- Host: GitHub
- URL: https://github.com/phphe/laravel-custom-config
- Owner: phphe
- License: mit
- Created: 2017-04-04T13:08:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-16T14:39:35.000Z (about 9 years ago)
- Last Synced: 2025-02-28T07:58:51.188Z (about 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-custom-config
JUST one file! a simple middleware to load and save custom config.
# Install
1 put CustomConfigMiddleware.php to your Middleware dir
2 use it as a middleware. You can put it in global, or middleware group, or some routes.
# Config
It uses default storage drive to save config to a file(default: 'system/customConfig.txt'). You can change the path or driver, it is easy.
$path: custom config file path.
$allowed: which root configs are allowed. Such as ['mail', 'youconfig']
# Usage
It will load custom config file and merge it to default config. Use it like default config.
You can get the instance of CustomConfigMiddleware by config('customConfig').
example:
config('customConfig')->save();
config('customConfig')->allowed;
# Save
It will put the instance of CustomConfigMiddleware to config root with key 'customConfig'. So use config('customConfig') to get instance, and config('customConfig')->save() to save config to file.