tuki/http-client-for-laravel

Laravel adapter package for tuki/http-client.

Maintainers

Package info

gitlab.com/Grupotuki/http-client-for-laravel

Issues

pkg:composer/tuki/http-client-for-laravel

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

v1.0.3 2026-03-18 00:32 UTC

This package is auto-updated.

Last update: 2026-04-17 23:40:34 UTC


README

Laravel integration layer for tuki/http-client. Adds auto-discovery, a facade, database persistence, async sink dispatch, framework events, and first-class test support — all wired to the Laravel container.

Profiles can also define reusable authentication through seal providers, so a bearer token or HTTP Basic setup lives in config and is applied automatically to every request sent through that profile.

Requirements

  • PHP: 7.4.* || 8.*
  • Laravel: >= 8.0
  • PHP extensions: ext-curl, ext-json
  • Core dependency: tuki/http-client:^1.0

Installation

composer require tuki/http-client-for-laravel

Publish config and migrations, then migrate:

php artisan vendor:publish --provider="Tuki\HttpClientForLaravel\TukiHttpClientForLaravelServiceProvider" --tag=config
php artisan vendor:publish --provider="Tuki\HttpClientForLaravel\TukiHttpClientForLaravelServiceProvider" --tag=migrations
php artisan migrate

Define your first profile in config/tuki_http_client.php:

'default_profile' => 'pokemon_api',

'profiles' => [
    'pokemon_api' => [
        'base_uri' => 'https://pokeapi.co/api/v2',
        'timeout' => 20,
        'connect_timeout' => 10,
    ],
],

Send a request via the facade:

use Tuki\HttpClientForLaravel\Facades\HttpClient;

$response = HttpClient::newRequest('pokemon.search')
    ->to('GET', '/pokemon/pikachu')
    ->expectsJson()
    ->execute();

$payload = $response->getJsonData();

→ For a complete setup walkthrough, see Installation and first success.

Documentation

License

MIT. See LICENSE.

Validation

composer test
composer stan
composer coverage

From the workspace root, the recommended execution path is the root Makefile:

make laravel-qa
make laravel-coverage

Inside this package, use Makefile targets directly. They support both local Docker and CI/direct execution:

make qa                 # local default: Docker mode
make qa USE_DOCKER=0    # CI/direct mode (no docker compose wrapper)