PHP code example of codebyray / carlistapi-laravel-sdk

1. Go to this page and download the library: Download codebyray/carlistapi-laravel-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codebyray / carlistapi-laravel-sdk example snippets


use CodebyRay\CarListApiLaravel\Facades\CarListApi;

$vehicle = CarListApi::vinDecoder()
    ->decode('1HGCM82633A004352')
    ->data;

use CodebyRay\CarListApiLaravel\CarListApiManager;

final class VehicleController
{
    public function __invoke(CarListApiManager $carListApi)
    {
        $years = $carListApi->automotive()->years()->data;

        return response()->json($years);
    }
}

use CodebyRay\CarListApiLaravel\Facades\CarListApi;

$makes = CarListApi::automotive()->makes()->data;
$models = CarListApi::automotive()->models(2026, 'Toyota')->data;
$details = CarListApi::automotive()->details($uuid)->data;

$decoded = CarListApi::vinDecoder()
    ->decode('1HGCM82633A004352', modelYear: 2003)
    ->data;

$types = CarListApi::powersports()->types()->data;
$years = CarListApi::powersports()->yearsByType('ATV / Utility')->data;
$models = CarListApi::powersports()
    ->modelsByYearMakeAndType('ATV / Utility', 2026, 'Can-Am')
    ->data;

$response = CarListApi::withToken($customerToken)
    ->automotive()
    ->years();

$response->data;
$response->status;
$response->headers;
$response->header('X-RateLimit-Remaining');
bash
php artisan vendor:publish --tag=carlistapi-config
bash
php artisan optimize:clear
text
codebyray/carlistapi-laravel-sdk/1.2.0