Download the PHP package ryangjchandler/laravel-json-settings without Composer
On this page you can find all versions of the php package ryangjchandler/laravel-json-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ryangjchandler/laravel-json-settings
More information about ryangjchandler/laravel-json-settings
Files in ryangjchandler/laravel-json-settings
Package laravel-json-settings
Short Description Store your Laravel application settings in an on-disk JSON file.
License MIT
Homepage https://github.com/ryangjchandler/laravel-json-settings
Informations about the package laravel-json-settings
Store your Laravel application settings in an on-disk JSON file.
This package provides a simple SettingsRepository
class that can be used to store your application's settings in a single JSON file.
Installation
You can install the package via composer:
You can publish the config file with:
Usage
You can resolve an instance of RyanChandler\LaravelJsonSettings\SettingsRepository
from the container by type-hinting it in any DI-supported method, e.g. a controller method.
The SettingsRepository
class contains the following methods:
get(string $key, mixed $default = null)
- retrieve the value of a setting by providing the key (dot-notation supported).set(string $key, mixed $value, bool $save = true)
- set the value of a setting and toggle auto-save.has(string $key)
- determine if a setting exists.save()
- manually save your settings back to disk.reload()
- clear the cache and reload the settings from disk.
If you prefer to use facades, you can interact with the RyanChandler\LaravelJsonSettings\Facades\Settings
facade directly too.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ryan Chandler
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-json-settings with dependencies
spatie/laravel-package-tools Version ^1.9.2
illuminate/contracts Version ^9.0