Package Data | |
---|---|
Maintainer Username: | ajmerainfo |
Maintainer Contact: | ajmerainfo@gmail.com (Keyur Ajmera) |
Package Create Date: | 2016-10-10 |
Package Last Update: | 2017-04-08 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-16 15:03:16 |
Package Statistics | |
---|---|
Total Downloads: | 5,767 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 0 |
Total Forks: | 0 |
Total Open Issues: | 0 |
This module allow you to store settings into database with easy commands. You can store as many as settings and it will fetch settings with caching so only one database query and all settings will store into cache.
Run
composer require klaravel/settings
in console to install this module
Open config/app.php
and in providers
section add:
Klaravel\Settings\ServiceProvider::class,
in aliases
section add:
'Setting' => Klaravel\Settings\SettingsFacade::class,
Now generate the Settings migration:
php artisan settings:migration
// for migrate database
php artisan migrate
You will see migration file on you /database/migrations/
folder.
Here's a quick example that shows how to use Setting
:
Setting::put('key', 'value'); // Insert settings into database
Setting::set('key', 'value'); // Insert settings into database
Setting::get('key'); // Get settings from database
Setting::has('key'); // Check key exits in database
Setting::forget('key'); // Delete key and value from database