2017 © Pedro Peláez
 

package settings

Laravel settings handler

image

grooveland/settings

Laravel settings handler

  • Tuesday, July 24, 2018
  • by grooveland
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel settings wrapper

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)

Installation

Laravel

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

Usage

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

Contributing

Comming soon., (*9)

Security

If you discover any security-related issues, please email develop@thegrooveland.com instead of using the issue tracker., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

24/07 2018

dev-master

9999999-dev

Laravel settings handler

  Sources   Download

MIT

by venespana

24/07 2018

v1.0

1.0.0.0

Laravel settings handler

  Sources   Download

MIT

by venespana