Download the PHP package spaaleks/laragistry without Composer
On this page you can find all versions of the php package spaaleks/laragistry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spaaleks/laragistry
More information about spaaleks/laragistry
Files in spaaleks/laragistry
Package laragistry
Short Description Laragistry - a minimal Laravel key/value registry
License GPL-3.0-only
Informations about the package laragistry
Laragistry - a minimal Laravel key/value registry
This Package contains a minimal registry logic for your Laravel 7+/8+ application.
The aim was to create a simple key/value provider for configuration purpose. For e.g. multi-domain applications, a scope can be used to separate entries.
This package does also work with the Laravel MongoDB driver from Jens Segers (jenssegers/laravel-mongodb)
Installation
Install the package via composer.
Run the artisan migration command to create the laragistry table.
Usage
After installing, you can use the Spaaleks\Laragistry\Laragistry class or it's alias (\Laragistry) in your project.
The scope argument is optional for every command.
| Method | Examples | Returns | Description |
|---|---|---|---|
| Create/update entry \Laragistry::set(array \$data, string \$scope = null) |
\Laragistry::set(['key', 'value']);\Laragistry::set(['key', 'value'], 'default'); |
entry object | This command will create a new entry or update a existing by key and scope. |
| Create/update multiple entries \Laragistry::set(array \$data, string \$scope = null) |
\Laragistry::set([['key1', 'value1'],['key2', 'value2']]); |
entry object or collection of entries | The same set command can be used to create/update multiple entries by providing a multidimensional array. |
| Get a single entry or multiple entries \Laragistry::get(\$data, string \$scope = null) |
\Laragistry::get('key');\Laragistry::get(['key1', 'key2']);\Laragistry::get('key_*');\Laragistry::get(['key1_*', 'key2_*']); |
entry object or collection of entries | Get a single entry or multiple entries by providden key(s). |
| Check \Laragistry::check(string \$key, string \$scope = null) |
\Laragistry::check('key1'); |
boolean | This command checks whether a key exists. |
| Get all in scope \Laragistry::getByScope(string \$scope) |
\Laragistry::getByScope('my_scope'); |
collection of entries | Return all key's in a scope. |
| Remove a single entry or multiple entries \Laragistry::remove(\$data, string \$scope = null) |
\Laragistry::remove('key');\Laragistry::remove(['key1', 'key2']); |
boolean | Remove a single entry or multiple entries by providden key(s). |