2017 © Pedro Peláez
 

library globalsettings

Laravel global settings, set/get global settings for your app

image

junaidnasir/globalsettings

Laravel global settings, set/get global settings for your app

  • Tuesday, April 17, 2018
  • by junaidnasir
  • Repository
  • 1 Watchers
  • 4 Stars
  • 693 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 32 % Grown

The README.md

Laravel Global Settings

Global Settings package for laravel, to quickly retrieve and store settings data in DB., (*1)

Installation

Begin by installing the package through Composer. Run the following command in your terminal:, (*2)

composer require junaidnasir/globalsettings

add the package service provider in the providers array in config/app.php:, (*3)

Junaidnasir\GlobalSettings\GlobalSettingsServiceProvider::class

you may add the facade access in the aliases array:, (*4)

'GlobalSettings'  => Junaidnasir\GlobalSettings\Facades\GlobalSettings::class

publish the migration and config file:, (*5)

php artisan vendor:publish"

migrate to create global_settings table, (*6)

php artisan migrate

Usage

You can use facade accessor to retrieve the package controller. Examples:, (*7)

GlobalSettings::set('allowUserSignUp',0);
GlobalSettings::set('userPostLimit',10);

// Get registration
if( GlobalSettings::get('allowUserSignUp'))
{
    //show form
}

// Post controller
if (count($user->post) >= GlobalSettings::get('userPostLimit'))
{
    // Can not create post limit reached
}

API

/* Set or update setting
*  $isActive is additional parameter 
*  to quickly disable a setting without
*  having to delete the setting
*/
set($Setting, $Value, $isActive = true);

/* Get Settings
*  return value of setting
*  or default value provided
*/
get($Setting, $default = null);

/* check if setting exists 
* return true if setting exists
* false otherwise
*/
has($Setting);

// Other Methods
update($setting, $value, $isActive);

isActive($setting);
activate($setting);
deactivate($setting);
delete($setting);

The Versions

17/04 2018

dev-master

9999999-dev https://github.com/junaidnasir/globalsettings

Laravel global settings, set/get global settings for your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Junaid Nasir

laravel settings options parameters

14/04 2016

v0.1.1

0.1.1.0 https://github.com/junaidnasir/globalsettings

Laravel global settings, set/get global settings for your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Junaid Nasir

laravel settings options parameters

14/04 2016

v0.1

0.1.0.0 https://github.com/junaidnasir/globalsettings

Laravel global settings, set/get global settings for your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Junaid Nasir

laravel settings options parameters