You can add and manage options within the configs and overwrite the application configs without having to change the values inside the config files.
composer require obelaw/o-configs
php artisan migrate
You can overwrite app configs
o_config()->get('app.name') // Laravel;
o_config()->set('app.name', 'Obelaw');
o_config()->get('app.name') // Obelaw;
You can manage options in a simple way with helpers.
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.
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.
Make sure the option is there
o_config()->has($path)
$path
: The option path.
Verify that the value exists within the configs table.
You can delete any option
o_config()->forget($path)
$path
: The option path.
Delete the option from the configs table if it exists.
use Obelaw\Configs\Support\Option;
Option::set($path, $value);
Option::get($path, $default = null);
Option::has($path);
Option::forget($path);
The MIT License (MIT). Please see The License File for more information.