Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Laravel Options

Latest Version on Packagist Total Downloads Software License CI

Global options module for Laravel application.

Installation

You can install the package via composer:

composer require overtrue/laravel-options -vvv

Publish configuration and migrations

$ php artisan vendor:publish --provider="Overtrue\LaravelOptions\OptionsServiceProvider"

Run migrations

$ php artisan migrate

Usage

// set
\Option::set('foo', 'bar');
\Option::set(['foo' => 'bar', 'bar' => 'baz']);

// get
\Option::get('foo'); // bar
\Option::get(['foo', 'bar']); // ['foo' => 'bar', 'bar' => 'baz']
\Option::all(['foo', 'bar']); // ['foo' => 'bar', 'bar' => 'baz']

// get all
\Option::get();
// or
\Option::all();

// check exists
\Option::has('foo'); // true

\Option::remove('foo'); 
\Option::remove(['foo', 'bar']);

Console commands

It is also possible to set options within the console:

php artisan option:set {key} {value}

Events

  • \Overtrue\LaravelOptions\Events\OptionCreated::class
  • \Overtrue\LaravelOptions\Events\OptionUpdated::class
  • \Overtrue\LaravelOptions\Events\OptionSaved::class
  • \Overtrue\LaravelOptions\Events\OptionDeleted::class
  • \Overtrue\LaravelOptions\Events\OptionRetrieved::class
  • \Overtrue\LaravelOptions\Events\Event::class

Testing

$ composer test

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》

License

MIT

About

Global options module for Laravel application.

Topics

Resources

License

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

You can’t perform that action at this time.