think.studio / laravel-gdc-info
GDC信息解析器
1.1.1
2023-09-22 13:29 UTC
Requires
- php: ^8.1
- ext-dom: *
- illuminate/support: ^9.0|^10.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.21
- guzzlehttp/guzzle: ^7.8
- orchestra/testbench: ^8.5
- phpunit/phpunit: ^10.2
- psalm/plugin-laravel: ^2.8
- vimeo/psalm: ^5.13
README
GDC信息解析器
安装
通过composer安装此包
composer require think.studio/laravel-gdc-info
可选地,您可以使用以下命令发布配置文件:
php artisan vendor:publish --provider="GDCInfo\ServiceProvider" --tag="config"
安装
- 创建设置表
public function up() { Schema::create( config('gdc-info.tables.gdc_info'), function ( Blueprint $table ) { \GDCInfo\MigrationHelper::defaultColumns($table); } ); }
- 如果需要,在AppServiceProvider中设置您的模型
namespace App\Models; class GDCInfo extends \GDCInfo\Models\GDCInfo { }
public function register() { GDCChecker::useModel(\App\Models\GDCInfo::class); }
使用方法
直接调用(您可以在没有模型和表的情况下使用它)
$gdcInfo = GDCInfoFromHtmlFlow::make()->get('060702'); // or $gdcInfo = GDCInfoFromHtmlFlow::make()->get(60702); $gdcInfo->gdc(); $gdcInfo->firstName(); $gdcInfo->lastName(); $gdcInfo->status(); $gdcInfo->registrantType(); $gdcInfo->qualifications(); $gdcInfo->firstRegisteredOn(); $gdcInfo->currentPeriodFrom(); $gdcInfo->additionalInfo();
使用模型
$gdcInfo = GDCInfo::findOrFetch(60702); $gdcInfo->getKey(); $gdcInfo->last_name;