0121GitHub
Laravel TypeSafe Jev
An unofficial Laravel package for Jev, with typed responses and test fakes.
butochnikov/laravel-typesafe-jevREADME ↗
# Laravel TypeSafe Jev [Русская документация](README.ru.md) Unofficial, community-maintained Laravel integration for [`butochnikov/typesafe-sdk-php`](https://github.com/Butochnikov/typesafe-sdk-php). It is not affiliated with Laravel or TypeSafe. This package keeps the SDK's typed DTOs, promises, and exceptions while adding Laravel package discovery, scoped lazy DI, configuration, a facade, and a recording fake. Jev `Noul` and `Score` are probability/score questions; this package is not a text-generation or chat client. ## Requirements | Package | Supported versions | | --- | --- | | Laravel 12 | PHP 8.2–8.5 | | Laravel 13 | PHP 8.3–8.5 | | TypeSafe SDK | `butochnikov/typesafe-sdk-php:^0.1` | ## Install ```bash composer require butochnikov/laravel-typesafe-jev php artisan vendor:publish --tag=jev-config ``` The provider is auto-discovered. Manual registration is also supported with `Butochnikov\LaravelTypeSafeJev\JevServiceProvider::class`. The package does not register a global `Jev` alias. Set the key in `.env`: ```dotenv TYPESAFE_API_KEY=your-key TYPESAFE_DEFAULT_MODEL=jev-latest TYPESAFE_BASE_URL=https://api.typesafe.ai TYPESAFE_TIMEOUT=10 ``` The key is validated only when a real SDK client is first used, so package discovery, `artisan list`, and `config:cache` work without a key. Config values are the source of truth after caching; the adapter passes these connection settings explicitly to the SDK. Logging has the exception described below. Numeric env values are validated and normalized when the lazy client is resolved. Invalid configuration fails then with a descriptive exception, not during provider registration. ## Use the facade or DI ```php use Butochnikov\LaravelTypeSafeJev\Facades\Jev; use TypeSafe\Choice; use TypeSafe\Noul; use TypeSafe\Score