Download the PHP package timatic/php-sdk without Composer

On this page you can find all versions of the php package timatic/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-sdk

Timatic PHP SDK

Tests codecov Code Style Static Analysis

A Laravel package for the Timatic API, built with Saloon and automatically generated from OpenAPI specifications.

Requirements

Installation

Configuration

The package automatically registers itself via Laravel auto-discovery.

Publish the config file:

Add your API credentials to .env:

Usage

Using Dependency Injection

The SDK connector is automatically registered in Laravel's service container, making it easy to inject into your controllers, commands, and other classes:

In Console Commands:

Testing

When testing code that uses the Timatic SDK, you can mock the connector and its responses using factories. The SDK includes factory classes for all DTOs that make it easy to generate test data.

Here's an example of testing the BudgetController from the example above:

Factory Methods

Every DTO in the SDK has a corresponding factory class with the following methods:

For more information on mocking Saloon requests, see the Saloon Mocking Documentation.

Pagination

The SDK supports automatic pagination for all collection endpoints using Saloon's pagination plugin:

The paginator:

Custom Response Methods

All responses are instances of TimaticResponse which extends Saloon's Response with JSON:API convenience methods:

HTTP Methods

This SDK follows REST best practices and does not support PUT requests. Instead:

PUT is intentionally excluded because resources are never completely replaced by Timatic.

Available Resources

The SDK provides access to the following resources:

JSON:API Support

This SDK uses a custom JSON:API DTO Generator that automatically flattens JSON:API attributes into proper Model properties. Instead of having generic $attributes, $type, and $relationships objects, each model has specific typed properties.

Example

Instead of:

You get:

Model Features

Regenerating the SDK

This SDK is automatically generated from the Timatic API OpenAPI specification using a custom JSON:API generator. To regenerate the SDK with the latest API changes:

This will:

  1. Download the latest OpenAPI specification from the API
  2. Generate Models with flattened JSON:API attributes
  3. Update the autoloader
  4. Format the code with Laravel Pint

How It Works

The SDK uses a custom JsonApiDtoGenerator that:

  1. Detects JSON:API schemas in the OpenAPI specification
  2. Extracts properties from the attributes object
  3. Generates proper Model classes with specific properties
  4. Adds #[Property] and #[DateTime] attributes
  5. Uses Carbon for datetime fields

Development

Running Tests

License

This package is licensed under the Elastic License 2.0 (ELv2).

Credits


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
saloonphp/saloon Version ^3.0
nesbot/carbon Version ^2.0|^3.0
saloonphp/pagination-plugin Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package timatic/php-sdk contains the following files

Loading the files please wait ...