2017 © Pedro Peláez
 

library laravel-options

Global options loaded from the database

image

appstract/laravel-options

Global options loaded from the database

  • Monday, January 22, 2018
  • by gizburdt
  • Repository
  • 6 Watchers
  • 122 Stars
  • 2,607 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 11 Versions
  • 53 % Grown

The README.md

Laravel Options

Latest Version on Packagist Total Downloads Software License, (*1)

Global key-value store in the database, (*2)

Installation

To get started with laravel-options, use Composer to add the package to your project's dependencies:, (*3)

composer require appstract/laravel-options

Publish, migrate

By running php artisan vendor:publish --provider="Appstract\Options\OptionsServiceProvider" in your project all files for this package will be published. For this package, it's only a migration. Run php artisan migrate to migrate the table. There will now be an options table in your database., (*4)

Usage

With the option() helper, we can get and set options:, (*5)

// Get option
option('someKey');

// Get option, with a default fallback value if the key doesn't exist
option('someKey', 'Some default value if the key is not found');

// Set option
option(['someKey' => 'someValue']);

// Remove option
option()->remove('someKey');

// Check the option exists
option_exists('someKey');

If you want to check if an option exists, you can use the facade:, (*6)

use Option;

$check = Option::exists('someKey');

The helpers are available as Blade directives:, (*7)

@option('someKey')

@option('someKey', 'Default value')

@optionExists('someKey')
    // Code
@endif

Console

It is also possible to set options within the console:, (*8)

php artisan option:set {someKey} {someValue}

Testing

$ composer test

Contributing

Contributions are welcome, thanks to y'all :), (*9)

About Appstract

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon., (*10)

License

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

The Versions

22/01 2018

dev-master

9999999-dev https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

22/01 2018

1.0.0

1.0.0.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

21/10 2017

0.4.0

0.4.0.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

09/10 2017

0.3.3

0.3.3.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

04/10 2017

0.3.2

0.3.2.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

15/06 2017

0.3.1

0.3.1.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

04/05 2017

0.3.0

0.3.0.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

22/03 2017

dev-updated-readme

dev-updated-readme https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

22/03 2017

0.2.0

0.2.0.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

19/03 2017

0.1.1

0.1.1.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options

17/03 2017

0.1.0

0.1.0.0 https://github.com/appstract/laravel-options

Global options loaded from the database

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-options