laravel-settings | Laravel 5.1.x Persistent Settings | Caching library
kandi X-RAY | laravel-settings Summary
kandi X-RAY | laravel-settings Summary
Laravel 5.1.x Persistent Settings (Database + Cache)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Set a setting value .
- Register the settings .
- Fetch setting value .
- Bootstrap the application .
- Store the settings .
- Create the settings table .
- Get all values
- Check cache file .
- Flush the cache .
- Provides a list of settings
laravel-settings Key Features
laravel-settings Examples and Code Snippets
composer require efriandika/laravel-settings
"require": {
"efriandika/laravel-settings": "1.*"
}
'Efriandika\LaravelSettings\SettingsServiceProvider',
'Settings' => Efriandika\LaravelSettings\Facades\Settings::class,
$ php artisan
// Change your config/settings.php
'fallback' => true
/*
* If the value with key => mail.host is not found in cache or DB of Larave Settings
* it will return same value as config::get('mail.host');
*/
Settings::get('mail.host');
Settings::set('key', 'value');
$value = Settings::get('key');
$value = Settings::get('key', 'Default Value');
$value = settings('key');
$value = settings('key', 'default value');
Settings::forget('key');
Settings::flush();
Community Discussions
Trending Discussions on laravel-settings
QUESTION
In an application I am building, I want to include a few custom artisan commands for updating application config settings like the app name, and database connections. This is mostly because some people that will need to be able to modify these settings are not familiar with Laravel (some of them are still college students). So, I want them to be able to easily modify these settings by simply calling an artisan command.
A problem I am currently running into is that updating config settings using the config() function is not persistent. So, I did a quick search on the internet for a solution. I found this solution on a similar question here on Stack Overflow. However, when importing the library, composer notifies me that the project has been abandoned and it would be best to find a different solution.
So, is there another solution to help with this task?
Thanks in advance.
...ANSWER
Answered 2018-Apr-10 at 09:04This solution does not use artisan file but uses command line interface.
If python is available in your environment, you can move the settings to be modified to your .env file and than install "python-dotenv[cli]" package to modify them without changing your source code.
You can install the package via pip:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install laravel-settings
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page