webmachine/settings

Settings for Laravel 5

dev-master 2022-03-10 18:47 UTC

This package is auto-updated.

Last update: 2024-11-11 00:49:44 UTC


README

Install

Via Composer

$ composer require webmachine/settings

Next, you must install the service provider and facade alias:

// config/app.php
'providers' => [
    ...
    Webmachine\Settings\SettingsServiceProvider::class,
];

...

'aliases' => [
    ...
    'Settings' => Webmachine\Settings\SettingsFacade::class,
];

Publish

$ php artisan vendor:publish --provider="Webmachine\Settings\SettingsServiceProvider"

Usage

In your models or controllers:

...
use Webmachine\Settings\SettingsFacade as Settings;

class Foo extends ... {
    ...
    public function myfoo() {
        $my_setting = Settings::get('mygroup.mysetting');
    }
}

In your views

Settings::get('mygroup.mysetting')

License

The MIT License (MIT). Please see License File for more information.