daltcore/registery

This package is abandoned and no longer maintained. The author suggests using the daltcore/registery-ng package instead.

Static text registery db for laravel

v1.1.4 2023-07-18 08:03 UTC

This package is auto-updated.

Last update: 2023-07-18 08:03:29 UTC


README

Latest Version on Packagist Software License Total Downloads FOSSA Status

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.

FOSSA Status