dev-master
9999999-devStore custom settings in database and add cache layer for performance
MIT
The Requires
- php >=5.3.0
- illuminate/support ~4|~5
The Development Requires
by Robert Lord
database laravel cache illuminate
Wallogit.com
2017 © Pedro Peláez
Store custom settings in database and add cache layer for performance
Store and handle custom settings in the database. Will use the Laravel cache system to minimize database queries., (*2)
In the require key of composer.json file add the following, (*3)
"codepeak/dsettings": "dev-master"
Run the Composer update comand, (*4)
$ composer update
In your config/app.php add 'Codepeak\Dsettings\DsettingsServiceProvider' to the end of the $providers array, (*5)
'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, (*6)
'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, (*7)
$ php artisan migrate --package=codepeak/dsettings
Get value from the database (or cache if fetched earlier), (*8)
\DSetting::get('database.key');
Store or update value, (*9)
\DSetting::set('database.key', 'my nice value');
Store custom settings in database and add cache layer for performance
MIT
database laravel cache illuminate