2017 © Pedro Peláez
 

library option

Persistent key value options for Laravel

image

hisman/option

Persistent key value options for Laravel

  • Wednesday, November 1, 2017
  • by hisman
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel Options

Persistent key value options for Laravel., (*1)

Installation

Install the package via composer:, (*2)

composer require hisman/option

Provider

If you're using Laravel < 5.5, you'll need to add the service provider to config/app.php file:, (*3)

'providers' => [
    ...

    Hisman\Option\OptionServiceProvider::class,

    ...
]

Alias

Add the alias to config/app.php file:, (*4)

'aliases' => [
    ...

    'Option' => Hisman\Option\Facade\Option::class,

    ...
]

Migration

You must run the migration php artisan migrate before using this package. It creates options table in your database that will be used for storing the options., (*5)

Usage

Using Facade, (*6)

// Set option
Option::set('name', 'value');
Option::set('name', [1, 2, 3]);

// Get option
$option = Option::get('name');

// Get option with default value
$option = Option::get('name', 'default value');

Using helper function, (*7)

// Set option
option()->set('name', 'value');
option()->set('name', [1, 2, 3]);

// Get option
$option = option('name');
$option = option()->get('name');

// Get option with default value
$option = option('name', 'default value');
$option = option()->get('name', 'default value');

The Versions

01/11 2017

dev-master

9999999-dev

Persistent key value options for Laravel

  Sources   Download

MIT

The Development Requires

01/11 2017

1.0.0

1.0.0.0

Persistent key value options for Laravel

  Sources   Download

MIT

The Development Requires