https://github.com/b-deshayes/laravel-settings
🔑 Simple key/value secure settings systme stored in database
https://github.com/b-deshayes/laravel-settings
encryption key-value laravel persistent setting
Last synced: about 2 months ago
JSON representation
🔑 Simple key/value secure settings systme stored in database
- Host: GitHub
- URL: https://github.com/b-deshayes/laravel-settings
- Owner: b-deshayes
- License: mit
- Archived: true
- Created: 2020-07-21T16:10:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T21:31:55.000Z (about 3 years ago)
- Last Synced: 2025-07-22T15:51:24.176Z (7 months ago)
- Topics: encryption, key-value, laravel, persistent, setting
- Language: PHP
- Homepage:
- Size: 242 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# laravel-settings

Simple key/value secure settings stored in database
## Installation
Install the package via composer.
```bash
composer require kotus/laravel-settings
```
Publish the config file and fill in the configs. Be sure to provide defaults settings before running the `php artisan migrate` command.
```bash
php artisan vendor:publish --provider="Kotus\Settings\Providers\SettingsServiceProvider" --tag="config"
```
Be sure to run migration to create the settings table.
```bash
php artisan migrate
```
## Usage
You can now use any of the following methods to handle your settings.
```php
Settings::get($key = null, array $options = [])
Settings::has(string $key, array $options = []): bool
Settings::set(string $key, string $value, array $options = []): bool
Settings::add(string $key, string $value, array $options = []): bool
Settings::flushCache(array $tenants = []): void
```
At any point, you can pass a specific tenant in option like this:
```php
$value = Settings::get('my_settings', ['tenant' => 'my_tenant']);
```
All settings are cache by tenant category depending on the ttl defined in config file. Default is 30 minutes. Whenever you add or change a setting, the cache is flush.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://choosealicense.com/licenses/mit/)