Search by

logipro / system-learning-php

fredlogipro

PHP client for the System Learning REST API (`/api/system`)

v0.1.0 2026-11-11 15:29 UTC

This package is not auto-updated.

Last update: 2026-11-11 18:45:17 UTC


README

PHP 7.4 client for the System Learning external REST API (/api/system/...).

HTTP is provided by logipro/turbolead-api (TransportFactory, shared exceptions). This package exposes resource-oriented entry points and DTOs for the system-learning OpenAPI contract (docs/api/openapi.yaml).

Install

composer require logipro/system-learning-php

Installable from Packagist. Requires PHP 7.4+, a PSR-18 HTTP client, and a Bearer API token (tlk_<prefix>_<secret>). The Turbolead base URL is the scheme and host.

Quick start

use Logipro\Turbolead\System\SystemLearningClient;
use Logipro\Turbolead\System\Query\ListTrainingsQuery;

$client = SystemLearningClient::create(
    getenv('TLK_TOKEN'),
    getenv('TLK_BASE_URL')
);

$health = $client->health()->show();
$catalog = $client->trainingCategories()->list();
$trainings = $client->trainings()->list(new ListTrainingsQuery(null, null, 'excel'));
$session = $client->interSessions()->get(15);

Resources

ResourceMethods
health()show()
trainingCategories()list(), get(int $id)
trainings()list(?ListTrainingsQuery), get(int $id), interSessions(int $trainingId, ?ListTrainingInterSessionsQuery)
interSessions()list(?ListInterSessionsQuery), get(int $id), register(int $sessionId, CreateRegistrationRequest)

List query objects mirror OpenAPI query parameter names (category_id, include_descendants, q, type, page, limit, training_id, starts_from, starts_to, registration_open).

Errors

API errors are thrown as classes from Logipro\Turbolead\Client\Exception\ (UnauthorizedException, NotFoundException, ValidationException, …). An empty Bearer token is rejected locally with InvalidConfigurationException before any HTTP call.

Development

./install          # composer install + demo stack
./codecheck        # phpcs, phpstan, phpunit
bin/infection      # mutation testing
bin/integration    # HTTP fixture integration tests

Demo nginx + php-fpm: ./start / ./stop (default host port 35082, project system-learning-php).

git clone git@gitlab.logipro.com:opensource/turbolead/system-learning-php.git

composer.lock is not committed. To develop against a local checkout of the transport:

composer config repositories.turbolead-api path ../turbolead-api

License

MIT