Laravel settings handler
This package allows you to manage settings in a database., (*1)
The settings are handled by groups and types of data (string, boolean, integer, double, array), (*2)
This package can be used in Laravel 5.4 or higher., (*3)
You can install via composer:, (*4)
composer require grooveland/settings
In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:, (*5)
'providers' => [ // ... \Grooveland\Settings\SettingsServiceProvider::class, ];
Now, run your migrations:, (*6)
php artisan migrate
this is a list of basic methods in model, (*7)
/** * Add a settings value * * @param $name * @param $val * @param string $type | optional * @return bool */ public static function add($group, $name, $val, $type = Core::DEFAULT_TYPE); /** * Edit a settings by id * allow to change name, group, value and type * * @param $id * @param $group * @param $name * @param $val * @param string $type | optional * @return bool */ public static function edit($id, $group, $name, $val, $type = Core::DEFAULT_TYPE); /** * Get settings by group or by group and name * if first is true return only first found setting * * @param string $group * @param string $name * @param boolean $first (false) * @return Settings | Array */ public static function get(string $group, string $name = null, bool $first = false); /** * Get first settings by group or by group and name * * @param string $group * @param string $name * @return Settings | Array */ public static function first(string $group, string $name = null); /** * Get first settings name * * @param string $name * @return Settings | Array */ public static function one(string $name); /** * Check if exists settings by name * * @param string $name * @return boolean */ public static function exists($name);
This is a CONSTAT with available types, (*8)
\Grooveland\Settings\Core::TYPES
Comming soon., (*9)
If you discover any security-related issues, please email develop@thegrooveland.com instead of using the issue tracker., (*10)
The MIT License (MIT). Please see License File for more information., (*11)