Via Composer
Case laravel 5.x
$ composer require sonar/valiable:1.*
Case laravel 6.x
$ composer require sonar/valiable:2.*
Add ServiceProvider in config.php
'providers' => [
:
:
Sonar\Valiable\ValiableServiceProvider::class,
],
'aliases' => [
:
:
'Valiable' => Sonar\Valiable\ValiableFacade::class,
],
Artisan Command
$ php artisan vendor:publish
Create Valiables Directory to storage_path put Yaml Files to Valiables Direcoty
Example:
properties:
parameter_kinds:
name: "種別"
value:
"1": "土地"
"2": "一戸建て"
"3": "マンション"
Valiable Import
$ php artisan valiable:import
Example Code
use Valiable;
print_r(Valiable::get('properties_parameter_kinds')); # Array([1] => 土地 [2] => 一戸建て [3] => マンション )
print_r(Valiable::getValue('properties_parameter_kinds',1)); # 土地
print_r(Valiable::getNames()); # Array([0] => properties_parameter_kinds)
The MIT License (MIT). Please see License File for more information.