phpinnacle / langcat
Framework-agnostic PHP client for the LangLion API.
Requires
- php: ^8.4
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-01 15:41:33 UTC
README
Langcat is a framework-agnostic PHP 8.4 client for LangLion API v4. It depends only on PSR HTTP interfaces, so the application chooses the HTTP client and PSR-17 implementation.
Installation
composer require phpinnacle/langcat
Usage
use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Psr7\HttpFactory; use PHPinnacle\Langcat\Client; use PHPinnacle\Langcat\Enum\StudentType; use PHPinnacle\Langcat\Request\Authorization\AuthenticateRequest; use PHPinnacle\Langcat\Request\Students\ListStudentsRequest; $factory = new HttpFactory(); $client = new Client( 'https://your-instance.langlion.com/api/v4', new HttpClient(), $factory, $factory, ); $token = $client->authorization()->authenticate( AuthenticateRequest::make() ->clientId('client-id') ->clientSecret('client-secret'), ); $students = $client ->withAccessToken($token->accessToken) ->students() ->all( ListStudentsRequest::make() ->page(1) ->perPage(20) ->type(StudentType::Lead) ->archived(false), );
Requests use fluent builders and validate caller input. Successful API payloads are returned as typed readonly response objects. Non-successful HTTP responses throw ApiException and retain the status, raw body, and typed LangLion error when available.
Request and response namespaces mirror API domains, for example Request\Students, Response\Groups, and Response\Finances. Cross-domain DTOs live under Request\Shared and Response\Shared.
All 125 operations from the LangLion API v4 specification are implemented:
POST /tokenPOST /token/refreshGET /meGET /studentsGET /students/{id}POST /studentsPATCH /students/{id}DELETE /students/{id}POST /students/{id}/archivePOST /students/{id}/restorePOST /students/{id}/schoolsGET /students/searchGET|PATCH /students/{id}/detailsGET /students/{id}/accessGET /students/{id}/consentsGET /students/{id}/parentsGET|PATCH /students/{id}/parents/{parentId}GET|PATCH /students/{id}/parents/{parentId}/detailsGET /students/{id}/parents/{parentId}/accessGET /students/{id}/parents/{parentId}/consentsGET /administratorsGET /administrators/{id}GET /administrators/{id}/detailsGET /classroomsGET /classrooms/{id}GET /companiesGET /companies/{id}GET /companies/{id}/detailsGET /companies/{id}/accessGET /schoolsGET /schools/{id}GET /teachersGET /teachers/{id}GET|PATCH /teachers/{id}/detailsGET /teachers/{id}/consentsGET /users/searchGET /eventsGET /events/{id}GET /documents/templatesGET /documents/templates/{id}GET|POST /webhooksGET|DELETE /webhooks/{id}GET|POST /groupsGET /groups/searchGET|PATCH /groups/{id}GET|POST /groups/{id}/lessonsGET|PATCH /groups/{id}/lessons/{lessonId}GET /groups/{id}/lessons/{lessonId}/attendanceGET|POST /groups/{id}/studentsGET /groups/{id}/students/{studentId}PATCH /groups/{id}/students/{studentId}/assign-typeGET /groups/{id}/students/{studentId}/gradesGET /groups/{id}/students/{studentId}/grades/collectionsGET /groups/{id}/teachersGET /groups/{id}/teachers/{teacherId}GET /groups/settings/coursesGET /groups/settings/courses/{id}GET /groups/settings/levelsGET /groups/settings/levels/{id}GET /groups/settings/lesson-statusesGET /groups/settings/lesson-statuses/{id}GET /groups/settings/group-typesGET /groups/settings/group-types/{id}GET /groups/settings/grades/collectionsGET /groups/settings/grades/collections/{id}GET /groups/settings/grades/collections/{collectionId}/itemsGET /groups/settings/grades/collections/{collectionId}/items/{id}GET /groups/settings/course-booksGET /groups/settings/course-books/{id}GET /groups/settings/attendance-statusesGET /groups/settings/attendance-statuses/{id}GET /groups/settings/lesson-detailsGET /groups/settings/lesson-details/{id}GET|POST /groups/settings/programs/collectionsGET|PATCH|DELETE /groups/settings/programs/collections/{id}GET|POST /groups/settings/programs/collections/{id}/itemsGET|PATCH|DELETE /groups/settings/programs/collections/{id}/items/{itemId}POST /groups/settings/programs/collections/{id}/items/set-ordersGET /groups/settings/languagesGET /groups/settings/languages/{id}GET /groups/settings/subjectsGET /groups/settings/subjects/{id}GET|POST /groups/{id}/settingsGET|PATCH /groups/{id}/settings/{settingId}GET /groups/settings/age-groupsGET /groups/settings/age-groups/{id}GET|POST /finances/settings/installments/collectionsGET|PATCH|DELETE /finances/settings/installments/collections/{id}GET|POST /finances/settings/installments/collections/{collectionId}/itemsGET|PATCH|DELETE /finances/settings/installments/collections/{collectionId}/items/{id}PATCH /finances/settings/installments/collections/{collectionId}/items/{id}/tagsGET|POST /finances/settings/installments/tagsGET|PATCH /finances/settings/installments/tags/{id}GET|POST /groups/{id}/students/{studentId}/installmentsGET|PATCH /groups/{id}/students/{studentId}/installments/{installmentId}PATCH /groups/{id}/students/{studentId}/installments/{installmentId}/tags
The package does not register Laravel service providers or resolve dependencies from a container.