2017 © Pedro Peláez
 

metpackage settisizer

Easy implementable package to handle application settings for different scopes with flexible storage places

image

swavel/settisizer

Easy implementable package to handle application settings for different scopes with flexible storage places

  • Wednesday, March 28, 2018
  • by simonfunk
  • Repository
  • 6 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Settisizer

A nice little package to set and get settings on different scopes. In the current state, you can define settings for a eloquent model (which defines the scope) and general settings (which are always in always in the global scope). There are, or at least will be, different drivers, so your settings can be stored everywhere you want. Yay!, (*1)

Installation

composer require swavel/settisizer 

Holy shit, that was easy! Now let's go, (*2)

Usage

In a model

The only thing you have to do to use the settisizer in a model (besides to include it in your composer dependencies) is to use the trait in the class like this:, (*3)

<?php namespace Your\Awesome\Proiject

class Fu extends Model {

    use Settisizable;
    [...]

with that given, you just can use it in every instance of that class:, (*4)

$u = User::find(42);
$u->setSetting([settingname], [settingvalue]);
[...]
$u->getSetting([settingname]);

should there be no value stored for the requested setting, don't you worry child, we cover you there! No errors, just a sober null which will be returned. Yay again!, (*5)

Globaly

In the status quo, one have to have a instance of a concretion of a Settisizer Class, which is, at the moment, always is one of the SettisizerStorage class., (*6)

$settisizer = new SettisizerStorage();
$settisizer->setSetting([globalsettingname], [settingvalue]);
[...]
$settisizer->getSetting([globalsettingname]);

To manage your own config. Run this command., (*7)

php artisan vendor:publish --provider=Settisizer\SettisizerServiceProvider

Developer hints

Run phpUnit tests with ../../../vendor/bin/phpunit, (*8)

Roadmap

Next steps

  • Comment the whole thing
  • Facade to access global Settisizer with
  • name the settings-table for driver mysql
<?php
Settisizer::getSetting('setting_name')

In progress

27.03.2018 - Write a second driver (mysql, redis), (*9)

Done

27.03.2018 - Integrate publish function to write standard config file (to select different drivers), (*10)

The Versions

28/03 2018

dev-master

9999999-dev

Easy implementable package to handle application settings for different scopes with flexible storage places

  Sources   Download

MIT

by The Swavels

23/01 2018

0.8.2

0.8.2.0

Easy implementable package to handle application settings for different scopes with flexible storage places

  Sources   Download

MIT

by The Swavels

15/11 2017

0.8.1

0.8.1.0

Easy implementable package to handle application settings for different scopes with flexible storage places

  Sources   Download

MIT

by The Swavels

15/11 2017

0.8

0.8.0.0

Settings dood

  Sources   Download

MIT

by The Swavels

21/03 2017

dev-develop

dev-develop

Settings dood

  Sources   Download

MIT

by The Swavels