2017 © Pedro Peláez
 

library l5-settings

Persistent settings in Laravel.

image

qwince/l5-settings

Persistent settings in Laravel.

  • Tuesday, September 5, 2017
  • by spitalia
  • Repository
  • 5 Watchers
  • 1 Stars
  • 60 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

Laravel Settings

Persistent, application-wide settings for Laravel., (*1)

Installation

  1. composer require qwince/l5-settings:dev-master
  2. Add qwince\LaravelSettings\SettingsServiceProvider::class, to the array of providers in config/app.php.
  3. Publish config file and migration by running php artisan vendor:publish --provider="qwince\LaravelSettings\SettingsServiceProvider".
  4. Optional: add 'Setting' => qwince\LaravelSettings\SettingsFacade::class, to the array of aliases in config/app.php.

Usage

Global settings

You can either access the setting store via its facade or inject it by type-hinting towards the abstract class qwince\LaravelSettings\SettingStore., (*2)

<?php
Setting::set('foo', 'bar');
Setting::get('foo', 'default value');
Setting::forget('foo');
$settings = Setting::all();
?>

User settings

Create a Setting model app/Setting.php using the following example:, (*3)

<?php namespace App;

use qwince\LaravelSettings\SettingModel;

class Setting extends SettingModel
{
}

Next, use the SettingUserTrait trait in your existing User model. For example:, (*4)

<?php
namespace App;
use qwince\LaravelSettings\Traits\SettingsUserTrait;

class User extends Authenticatable
{
    use SettingsUserTrait;
}

This will enable the relation with Setting and add the following methods settings(),hasSetting($key), getSetting($key), setSetting($key, $value, $description) activate($key) and deactivate($key) within your User model., (*5)

Contact

Open an issue on GitHub if you have any problems or suggestions., (*6)

License

The contents of this repository is released under the MIT license., (*7)

The Versions

05/09 2017

dev-master

9999999-dev

Persistent settings in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianluca Di Gesaro

24/11 2016

v0.4.1

0.4.1.0

Persistent settings in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianluca Di Gesaro

12/11 2016

v0.4

0.4.0.0

Persistent settings in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianluca Di Gesaro

07/11 2016

v0.1

0.1.0.0

Persistent settings in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianluca Di Gesaro