webmachine/settings
Settings for Laravel 5
351
| Install | |
|---|---|
composer require webmachine/settings |
|
| PHP: | >=5.5.0 |
| License: | MIT |
| Last Updated: | Mar 10, 2022 |
| Links: | GitHub · Packagist |
Maintainer: webmachine
Settings for Laravel 5
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.