kerrigan / laravel-dvla
Cached DVLA lookup service for use with Laravel.
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kerrigan/laravel-dvla
Requires
- php: ^8.4
- illuminate/cache: ^10.0|^11.0|^12.0
- illuminate/container: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- nesbot/carbon: ^3.11
- spatie/laravel-data: ^4.18
Requires (Dev)
- laravel/framework: ^10.0|^11.0|^12.0
- mockery/mockery: ^1.4
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.22|^3.0
This package is not auto-updated.
Last update: 2025-12-26 11:24:14 UTC
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.