klaravel/settings

Laravel database settings manager.

v1.0.3 2017-04-08 17:10 UTC

This package is not auto-updated.

Last update: 2024-12-21 21:31:15 UTC


README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

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.

Installation:

  1. Run

    composer require klaravel/settings

    in console to install this module

  2. Open config/app.php and in providers section add:

    Klaravel\Settings\ServiceProvider::class,

    in aliases section add:

    'Setting' => Klaravel\Settings\SettingsFacade::class,
  3. 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.

Usage:

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