2017 © Pedro Peláez
 

library settingable

Store settings for an app or resource in the database

image

sinclairt/settingable

Store settings for an app or resource in the database

  • Wednesday, March 29, 2017
  • by sinclairt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Settable

Installation

  • Run composer require sinclairt/settable.
  • Register Sinclair\Settable\SettableServiceProvider::class in config\app.php inside the providers array.
  • Run composer dump-autoload
  • Run php artisan vendor:publish. This wil publish the migration for the settings.
  • Run php artisan migrate

Usage

Settings can be global or resource specific, for global settings, the $myObject in the examples below can be omitted or set to null, otherwise include the object whose setting you need., (*1)

Get

Shorthand: setting('some_key') will return the 'some_key' value. This will only return global settings, use the alternative method for resource settings, (*2)

Alternative: app('Settable')->get('some_key', $myObject, 'my_default') or setting()->get(...), (*3)

It will check whether the value is a callback and return the value of the callback., (*4)

Set

Shorthand: setting(['some_key', 'some_value', $myObject]) will set the 'some_key' key to 'some_value' and return boolean., (*5)

Alternative: app('Settable')->set('some_key', 'my_value', $myObject) or setting()->set(...), (*6)

Exists

app('Settable')->exists('some_key', $myObject) or setting()->exists(...)returns boolean, (*7)

The Versions

29/03 2017

dev-master

9999999-dev

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair

29/03 2017

1.0.6

1.0.6.0

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair

19/01 2017

1.0.5

1.0.5.0

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair

26/09 2016

1.0.3

1.0.3.0

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair

23/09 2016

1.0.2

1.0.2.0

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair

22/09 2016

1.0.1

1.0.1.0

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair

22/09 2016

1.0.0

1.0.0.0

Store settings for an app or resource in the database

  Sources   Download

MIT

The Development Requires

by Tom Sinclair