code16/machina-client

Client package for code16/machina
11,970
Install
composer require code16/machina-client
Latest Version:v3.8
PHP:8.3.*|8.4.*|8.5.*
License:MIT
Last Updated:Apr 13, 2026
Links: GitHub  ·  Packagist
Maintainer: code16

Machina Client

"code16/machina-client" is aimed to be used for implementing client to communicate with JSON APIs protected with the Code16/Machina JWT Token authentication guard. It's a simple wrapper around GuzzleHttp and takes cares of querying/refreshing JWT token for you.

Installation

    composer require code16/machina-client

Usage


    $client = new \Code16\MachinaClient\MachinaClient;

    $client->setBaseUrl("https://example.com/api");
    $client->setCredentials([
        "client" => "some-client-key",
        "secret" => "some-secret-key",
    ]);

    try {
        $client->get("/foo");  // ['foo => bar'];
    }
    catch(\Code16\MachinaClient\Exceptions\InvalidCredentialsException $e) 
    {
        // Incorrect credentials
    }

License

(c) 2018 code16.fr

MIT

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v3.8 8.3.*|8.4.*|8.5.* ^11.0|^12.0|^13.0 MIT
v3.7 ^8.3|^8.4|^8.5 ^11.0|^12.0 MIT
v3.6 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0 MIT
v3.5 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0 MIT
v3.4 ^8.1|^8.2|^8.3 ^10.0|^11.0 MIT