daltcore / registery
Static text registery db for laravel
Installs: 2 465
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7
- laravel/framework: *
This package is auto-updated.
Last update: 2023-07-18 08:03:29 UTC
README
Registery Database for Laravel
Install
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,
Usage
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.
Credits
License
The MIT License (MIT). Please see License File for more information.