Skip to content

You can add and manage options within the configurations and overwrite the application configurations without having to change the values inside the configuration files.

License

Notifications You must be signed in to change notification settings

obelaw/o-configs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

O Configs

You can add and manage options within the configs and overwrite the application configs without having to change the values inside the config files.

Install for laravel

composer require obelaw/o-configs

Migrate configs table

php artisan migrate

Overwrite app configs

You can overwrite app configs

o_config()->get('app.name') // Laravel;

o_config()->set('app.name', 'Obelaw');
o_config()->get('app.name') // Obelaw;

Usage

You can manage options in a simple way with helpers.

Add Option

You can add an option through the following line

o_config()->set($path, $value);

$path: The option path that you will use to fetch its value.

$value: Put the value of any type of data.

If this path exists on config files It will be overwritten without modifying the value inside the file.

Get Option

Fetching value for a specific option

o_config()->get($path, $default = null)

If this path does not exist in the configs table, the value will be fetched from within the file, otherwise, the default value will be displayed if you set.

$path: The option path.

$default: You can specify a default value if the option is not found.

Has Option

Make sure the option is there

o_config()->has($path)

$path: The option path.

Verify that the value exists within the configs table.

Forget Option

You can delete any option

o_config()->forget($path)

$path: The option path.

Delete the option from the configs table if it exists.

Use facade

use Obelaw\Configs\Support\Option;

Option::set($path, $value);
Option::get($path, $default = null);
Option::has($path);
Option::forget($path);

License

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

About

You can add and manage options within the configurations and overwrite the application configurations without having to change the values inside the configuration files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages