PHPackages                             gertexllc/yii2-vin-decoder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gertexllc/yii2-vin-decoder

ActiveYii2-extension

gertexllc/yii2-vin-decoder
==========================

A Yii2 component for decoding vehicle VINs

021PHP

Since May 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/gertexllc/yii2-vin-decoder)[ Packagist](https://packagist.org/packages/gertexllc/yii2-vin-decoder)[ RSS](/packages/gertexllc-yii2-vin-decoder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

VinDecoder
==========

[](#vindecoder)

`VinDecoder` is a Yii2 component that decodes vehicle VINs using the NHTSA VIN decoder API. The component validates whether the VIN is correctly formatted and the check digits are correct, then submits it to the API and returns the result as an associative array.

Installation
------------

[](#installation)

You can install the `VinDecoder` component using [Composer](https://getcomposer.org/) by running the following command:

```
composer require gertexllc/yii2-vin-decoder

```

Usage
-----

[](#usage)

To use the `VinDecoder` component in your Yii2 application, you first need to configure it in your application configuration file (`config/main.php`):

```
'components' => [
    'vinDecoder' => [
        'class' => 'gertexllc\vindecoder\VinDecoder',
    ],
],
```

You can then use the `VinDecoder` component in your application code to decode VINs. Here's an example:

```
try {
    $vin = '1GNKVJED9CJ211239';
    $vinData = Yii::$app->vinDecoder->decode($vin);
    echo "Make: {$vinData->make}\n";
    echo "Model: {$vinData->model}\n";
    echo "Year: {$vinData->year}\n";
    echo "Trim: {$vinData->trim}\n";
    echo "Body Type: {$vinData->bodyType}\n";
    echo "Engine Type: {$vinData->engineType}\n";
    echo "Drive Type: {$vinData->driveType}\n";
    echo "Fuel Type: {$vinData->fuelType}\n";
    echo "Plant Country: {$vinData->plantCountry}\n";
    echo "Plant State: {$vinData->plantState}\n";
} catch (\Exception $e) {
    echo "Error: {$e->getMessage()}\n";
}
```

In this example, we first define a VIN to decode (`$vin`). We then call the `decode()` method of the `vinDecoder` component to decode the VIN, which returns a `VinData` object with the decoded data. We can then access the decoded data using the properties of the `VinData` object.

VinData Object
--------------

[](#vindata-object)

The `VinData` object is a simple data object that contains the decoded VIN data. The object has the following properties:

- `make` - The make of the vehicle.
- `model` - The model of the vehicle.
- `year` - The model year of the vehicle.
- `trim` - The trim level of the vehicle.
- `bodyType` - The body type of the vehicle.
- `engineType` - The engine type of the vehicle.
- `driveType` - The drive type of the vehicle.
- `fuelType` - The primary fuel type of the vehicle.
- `plantCountry` - The country where the vehicle was manufactured.
- `plantState` - The state or province where the vehicle was manufactured.

Requirements
------------

[](#requirements)

The `VinDecoder` component requires PHP 7.1 or later and the [Yii2 framework](https://www.yiiframework.com/) version 2.0 or later.

License
-------

[](#license)

The `VinDecoder` component is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Author
------

[](#author)

The `VinDecoder` was developed and brought to you free of charge by GerTex, LLC

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/240916dbb06efe8727f00784073979cd5c1d4c47ddb8bc23b202d29b170b649e?d=identicon)[gertexllc](/maintainers/gertexllc)

---

Top Contributors

[![gertexllc](https://avatars.githubusercontent.com/u/131615491?v=4)](https://github.com/gertexllc "gertexllc (7 commits)")

### Embed Badge

![Health badge](/badges/gertexllc-yii2-vin-decoder/health.svg)

```
[![Health](https://phpackages.com/badges/gertexllc-yii2-vin-decoder/health.svg)](https://phpackages.com/packages/gertexllc-yii2-vin-decoder)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
