LaravelPackages.net
Acme Inc.
Toggle sidebar
byancode/settings

Sync configs && BD.

79
0
1.0.10
About byancode/settings

byancode/settings is a Laravel package for sync configs && bd.. It currently has 0 GitHub stars and 79 downloads on Packagist (latest version 1.0.10). Install it with composer require byancode/settings. Discover more Laravel packages by byancode or browse all Laravel packages to compare alternatives.

Last updated

Laravel Settings

This package allows you to save the configuration in a more persistent way. Use the database to save your settings, you can save values in json format. You can also override the Laravel configuration.

Getting Started

1. Install

Run the following command:

composer require byancode/settings

2. Register (for Laravel > 6.0)

Register the service provider in config/app.php

Byancode\Settings\Provider::class,

Add alias if you want to use the facade.

'Setting' => Byancode\Settings\Facade::class,

3. Publish

Publish config file.

php artisan vendor:publish --provider="Byancode\Settings\Provider"

4. Configure

You can change the options of your app from config/settings.php file

Usage

You can either use the helper method like settings('foo') or the facade Settings::get('foo')

Facade

# GETTER  
Settings::get('foo');    
Settings::get('foo.bar'); 
Settings::get('foo__bar');

# SETTER  
Settings::set('foo', ['bar' => 'test']);
Settings::set('foo.bar', 'test');

Helper

$settings = settings();

# GETTER 
settings('foo');
$settings->foo;
settings('foo.bar');
$settings->foo__bar;
$settings->get('foo.bar');

# SETTER  
settings('foo', ['bar' => 'test']);
$settings->foo = ['bar' => 'test'];
$settings->foo__bar = 'test';
$settings->set('foo.bar', 'test');

Blade Directive

You can get the settings directly in your blade templates using the helper method or the blade directive like @settings('foo')

Star History Chart