Skip to content

Installation & Usage

Ben Sherred edited this page Dec 3, 2019 · 3 revisions

You can install the package via Composer. Run the following command:

composer require truckersmp/api-client

To use the package, use Composer's autoload:

require_once('vendor/autoload.php');

Usage

Once you have installed the package, you can create a new instance of the Client:

<?php

require_once('vendor/autoload.php');

$client = new TruckersMP\APIClient\Client();

Additional Config

This package uses Guzzle for gathering data from the API. If you want to change the Guzzle configuration, you can pass an array to the Client during initialization:

<?php

require_once('vendor/autoload.php');

$client = new TruckersMP\Client([
    // Guzzle config
]);

Clone this wiki locally