mtcmedia / automotive-specs
Vehicle specs manager / interface
Requires
- illuminate/support: >=6.0
Requires (Dev)
- orchestra/testbench: ^6.13
- phpunit/phpunit: ^9.3
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-03-12 15:26:33 UTC
README
This package provides the base structure for automotive specs APIs - interfaces and enum models for car valuation, specification and risk implementations across different APIs.
Installation
composer require mtcmedia/automotive-specs
For driver setup you will require setting up the config value of the default driver. This is defined in config file that can be published
php artisan vendor:publish --provider="Mtc\AutomotiveSpecs\Providers\AutomotiveSpecProvider"
Usage
This package is not aimed at a standalone use but in coupling with an actual automotive spec driver like CAP, MotorCheck or others.
System allows registering new Drivers:
use Mtc\AutomotiveSpecs\Facades\AutoSpecs;
AutoSpecs::register('driver-name', function () {
return new MyDriver();
});
AutoSpecs
uses a manager that will select driver defined in
automotive_specs.driver
value to run as the main driver.
Driver value can also be set through .env file as AUTOMOTIVE_SPECS_DRIVER
key.
A different active driver can be set using
AutoSpecs::setActiveDriver($driver_name)
method.
When driver is set up you can call methods on the driver or manager.
- Check if driver supports functionality
use \Mtc\AutomotiveSpecs\Facades\AutoSpecs; use \Mtc\AutomotiveSpecs\Contracts\CarValuationService;
$supported = AutoSpecs::supports(CarValuationService::class);
* Perform service action
use \Mtc\AutomotiveSpecs\Facades\AutoSpecs;
$supported = AutoSpecs::getCarSpecs($vrm, $mileage);
# Contributing
Please see [Contributing](CONTRIBUTING.md) for details.