shipwithjev

Catalog / Tools & apps

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

Also filed under Tools & apps

  1. 0573

    Support chat: agent offered a human escalation path

    A frustrated customer hits a bot loop twice; the judge checks whether a human handoff was offered.

    everyai-com · Tools & apps

  2. 0572

    Subscription cancel: effective date is explicit

    An agent cancels a subscription; the judge checks the exact date the cancellation takes effect.

    everyai-com · Tools & apps

  3. 0571

    Sales quote: numbers match the official price list

    An agent quotes $29/seat against a price list; the judge checks the quote matches exactly.

    everyai-com · Tools & apps

  4. 0570

    Refund chat: agent stated the amount before issuing it

    A support agent issues a $42.50 refund; the judge checks the exact amount was stated before the refund was confirmed.

    everyai-com · Tools & apps