composer require sunrise/vin
use InvalidArgumentException;
use Sunrise\Vin\Vin;
try {
$vin = new Vin('WVWZZZ1KZ6W612305');
} catch (InvalidArgumentException $e) {
// It isn't a valid VIN...
}
$vin->getVin(); // "WVWZZZ1KZ6W612305"
$vin->getWmi(); // "WVW"
$vin->getVds(); // "ZZZ1KZ"
$vin->getVis(); // "6W612305"
$vin->getRegion(); // "Europe"
$vin->getCountry(); // "Germany"
$vin->getManufacturer(); // "Volkswagen"
$vin->getModelYear(); // [2006]
// convert the VIN to a string
(string) $vin;
// converts the VIN to array
$vin->toArray();
- https://en.wikipedia.org/wiki/Vehicle_identification_number
- https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)
- https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)
- https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Model_year