sonar/valiable

v3.0.2 2022-09-06 05:27 UTC

README

Latest Version on Packagist Software License Coverage Status Quality Score Total Downloads

Install

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)

Credits

License

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