Skip to content

Latest commit

 

History

History
112 lines (78 loc) · 2.51 KB

README.md

File metadata and controls

112 lines (78 loc) · 2.51 KB

Registery

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