Download the PHP package bvtterfly/laravel-valuestore without Composer
On this page you can find all versions of the php package bvtterfly/laravel-valuestore. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bvtterfly/laravel-valuestore
More information about bvtterfly/laravel-valuestore
Files in bvtterfly/laravel-valuestore
Package laravel-valuestore
Short Description Easily store some values
License MIT
Homepage https://github.com/bvtterfly/laravel-valuestore
Informations about the package laravel-valuestore
🚨 THIS PACKAGE HAS BEEN ABANDONED 🚨
I no longer use Laravel and cannot justify the time needed to maintain this package. That's why I have chosen to abandon it. Feel free to fork my code and maintain your own copy.
Laravel Valuestore
This package makes it easy to store and retrieve some loose values. The values are saved as JSON/Yaml files.
The package integrates with the Laravel filesystem and adds Yaml support by extending the spatie/valuestore
package.
It can be used like this:
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
To create a Valuestore use the make
method.
You can also pass some values as a second argument. These will be added to the valuestore using the put
method.
All values will be saved as json/yaml in the given file.
When there are no values stored, the file will be deleted.
Cached Valuestore
Valuestore
would call the all
method behind the scene to get values from the store every time.
CachedValuestore
is an extension of Valuestore
with a local cache. With CachedValuestore
, the all
method gets values from the cache instead of reading the file to get the store values.
If you want to clear the cache, You can use the clearCache
method.
It is done during persistence, so you are unlikely to need it.
Valuestore methods
You can call the following methods on the Valuestore
& CachedValuestore
put
get
has
all
allStartingWith
forget
flush
flushStartingWith
pull
increment
decrement
push
prepend
count
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
- ARI
- All Contributors
Tim MacDonald was the original developer of the CachedValuestore
. We slightly polished the code he created in the repo.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-valuestore with dependencies
illuminate/contracts Version ^9.0
spatie/laravel-package-tools Version ^1.9.2
spatie/valuestore Version ^1.3
symfony/yaml Version ^6.0