avto-dev/static-references-laravel
最新稳定版本:v4.7.0
Composer 安装命令:
composer require avto-dev/static-references-laravel
包简介
Static references for Laravel applications
README 文档
README
Wrappers around data from static-references-data
Using this package you can get access to the data from package avto-dev/static-references-data simpler and more convenient.
Service-provider for integration with Laravel application comes too.
Install
Require this package with composer using the following command:
$ composer require avto-dev/static-references-laravel "^4.0"
Installed
composeris required (how to install composer).
You need to fix the major version of package.
Usage
Use illuminate service container for getting access to the references instances. For example, in artisan command:
<?php namespace App\Console\Commands; use AvtoDev\StaticReferences\References\SubjectCodes; use AvtoDev\StaticReferences\References\VehicleCategories; class SomeCommand extends \Illuminate\Console\Command { /** * The console command name. * * @var string */ protected $name = 'some:command'; /** * Execute the console command. * * @param SubjectCodes $subject_codes * @param VehicleCategories $vehicle_categories * * @return void */ public function handle(SubjectCodes $subject_codes, VehicleCategories $vehicle_categories): void { // Print all vehicle categories in a one string $this->info(collect($vehicle_categories)->pluck('code')->implode(', ')); // A, A1, B, BE... // Get all GIBDD codes for moscow subject $this->info($subject_codes->getByGibddCode(77)->getGibddCodes()); // [77, 97, 99, 177, ...] // Make GIBDD codes validation $subject_codes->hasGibddCode(777); // true $subject_codes->hasGibddCode(666); // false } }
All available references can be found in this directory.
Testing
For package testing we use phpunit framework and docker-ce + docker-compose as develop environment. So, just write into your terminal after repository cloning:
$ make build $ make latest # or 'make lowest' $ make test
Changes log
Changes log can be found here.
Support
If you will find any package errors, please, make an issue in current repository.
License
This is open-sourced software licensed under the MIT License.
统计信息
- 总下载量: 33.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-25