定制 kerrigan/laravel-dvla 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kerrigan/laravel-dvla

Composer 安装命令:

composer require kerrigan/laravel-dvla

包简介

Cached DVLA lookup service for use with Laravel.

README 文档

README

This Laravel package can retrieve and cache vehicle information from the UK DVLA.

Installation

This package relies upon PHP 8.4, as it uses a number of relatively new language features with which I wanted to get to grips.

You can install the package via composer:

composer require kerrigan/laravel-dvla

The package will automatically register itself.

Then assign values to the environment variables mentioned in the dvla.php configuration file.

You can publish the config file with:

php artisan vendor:publish --tag="laravel-dvla"

These are the contents of the published config file:

// config/dvla.php

return [
    /*
     * DVLA VES API configuration.
     */
    'api' => [
        /*
         * API key. 
         */
        'key' => env('DVLA_API_KEY', ''),
        
        /*
         * Use the live API?
         */
        'is_live' => env('DVLA_API_IS_LIVE', false),
        
        /*
         * Use a correlation ID for debugging purposes?
         */
        'correlation_id' => env('DVLA_API_CORRELATION_ID', null),
    ],

    /*
     * Should results be cached? The cache will keep results until midnight. DVLA data is updated 
     * daily, meaning that results queried via the VES lookup API will be valid until at least midnight. 
     */
    'cache_enabled' => env('DVLA_CACHE_ENABLED', false),
    
    /*
     * If `cache_enabled` is set to true, what prefix should be used to cache results?
     */
    'cache_prefix' => env('DVLA_CACHE_PREFIX', CachedVehicleLookup::DEFAULT_CACHE_PREFIX),
];

Usage

Basic usage

Simply use app(VehicleLookupService::class) to instantiate the service according to your configuration.

Then invoke the vehicleLookup() method, passing in a suitable valid UK registration string, e.g. AA01AAA.

统计信息

  • 总下载量: 2.21k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固