Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miladimos/conf
laravel dynamic application config
https://github.com/miladimos/conf
conf configuration-files configuration-management laravel laravel-config laravel-package lumen-config lumen-package
Last synced: 3 months ago
JSON representation
laravel dynamic application config
- Host: GitHub
- URL: https://github.com/miladimos/conf
- Owner: miladimos
- Created: 2021-06-18T07:22:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-10T23:21:24.000Z (almost 3 years ago)
- Last Synced: 2024-09-14T04:09:14.265Z (5 months ago)
- Topics: conf, configuration-files, configuration-management, laravel, laravel-config, laravel-package, lumen-config, lumen-package
- Language: PHP
- Homepage:
- Size: 41 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README-en.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
- (README.md)
# Laravel config package
### Installation
1. Run the command below to add this package:
```
composer require miladimos/conf
```2. Open your conf/app.php and add the following to the providers array:
```php
Miladimos\Conf\Providers\ConfServiceProvider::class,
```3. Run the command below to install package:
```
php artisan conf:install
```helpers:
conf('key') // return value of config
services:
```php
use Miladimos\Conf\Services\ConfigJsonService;ConfigJsonService::all(); // return all stored configs in config.json file
ConfigJsonService::show($id); // receive id of config and return one config
ConfigJsonService::store($date);
// receive ['key' => 'your_key', 'value' => 'your_value']
ConfigJsonService::update($date, $id);
// receive id of config and ['key' => 'your_key', 'value' => 'your_value'] for update
ConfigJsonService::delete($id); // receive id of config and delete
```routes:
```php
GET api/version/conf/all -> name: conf.all // return all configs
GET api/version/conf/show/{id} -> name: conf.show // return single config
POST api/version/conf/update/{id} -> name: conf.update // update
POST api/version/conf/store -> name: conf.store // store
GET api/version/conf/delete/{id} -> name: conf.delete // delete
```
update and store receive these datas
```php
[
'key' => 'yourkey',
'value' => 'yourvalue'
]
```then give to config.json file read,write permissions or chane owner file to current user:
sudo chown -R $USER config.json