mradang / laravel-options
laravel-options
v3.1.0
2023-03-20 16:24 UTC
Requires
- laravel/framework: ^9.0 || ^10.0
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.0
README
composer require mradang/laravel-options -vvv
配置
- 发布配置文件
php artisan vendor:publish --provider="mradang\\LaravelOptions\\LaravelOptionsServiceProvider"
- 刷新数据库迁移
php artisan migrate:refresh
添加的内容
添加的数据表迁移
- options
使用方法
直接存取
// 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::get('baz', 'abc'); // abc // has \Option::has('baz'); // false // remove \Option::remove('foo'); \Option::remove(['foo', 'bar']);