https://github.com/codepeak/dsettings
Store settings in the database and use cache to increase performance
https://github.com/codepeak/dsettings
Last synced: 2 months ago
JSON representation
Store settings in the database and use cache to increase performance
- Host: GitHub
- URL: https://github.com/codepeak/dsettings
- Owner: codepeak
- Created: 2014-02-21T22:25:09.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-04-24T19:59:29.000Z (almost 11 years ago)
- Last Synced: 2024-05-17T12:02:58.782Z (almost 2 years ago)
- Language: PHP
- Homepage:
- Size: 156 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DSetting (Laravel4 Package)
[](https://travis-ci.org/codepeak/dsettings)
Store and handle custom settings in the database. Will use the Laravel cache system to minimize database queries.
## Quick start
### Required setup
In the `require` key of `composer.json` file add the following
"codepeak/dsettings": "dev-master"
Run the Composer update comand
$ composer update
In your `config/app.php` add `'Codepeak\Dsettings\DsettingsServiceProvider'` to the end of the `$providers` array
'providers' => array(
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Codepeak\Dsettings\DsettingsServiceProvider',
),
At the end of `config/app.php` add `'DSetting' => 'Codepeak\Dsettings\Facades\DSetting'` to the `$aliases` array
'aliases' => array(
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
...
'DSetting' => 'Codepeak\Dsettings\Facades\DSetting',
),
Run the migration update command to create the `settings` table
$ php artisan migrate --package=codepeak/dsettings
### Usage
Get value from the database (or cache if fetched earlier)
\DSetting::get('database.key');
Store or update value
\DSetting::set('database.key', 'my nice value');