Registery Database for Laravel
Via Composer
$ composer require daltcore/registery
In your config/app.php
at Service Providers
DALTCORE\Registery\RegisteryServiceProvider::class,
In your config/app.php
at Aliasses
'Registery' => DALTCORE\Registery\Facade::class,
This is just an example!
Create a directory in app
called Registeries
Create a file called Config.php
with the following contents:
<?php
namespace App\Registeries;
use DALTCORE\Registery\Registery;
class Config extends Registery {
/**
* These properties are optional!
*/
protected $engine = Registery::JSONDB; // Registery::MEMORYDB Registery::NULLDB
protected $prefix = ''; // Prefix for the "keys"
protected $table = 'configs'; // Table name
}
Now you can access the registery trough the Config
class like:
$config = Config::get();
dump($config);
You can fill via:
$config->fill(['foo' => 'bar']);
dump($config);
$config->save();
or
$config->foo = 'baz';
dump($config);
$config->save();
or
$config->update(['foo' => 'bar']);
dump($config);
You can get the values like this:
dump($config->foo); // baz
or
You can get the values like this:
dump($config->get()); // array
If you discover any security related issues, please contact Ramon Smit.
The MIT License (MIT). Please see License File for more information.