cognesy/instructor-laravel

Laravel integration for Instructor PHP - Structured LLM outputs made simple

Maintainers

Package info

github.com/cognesy/instructor-laravel

pkg:composer/cognesy/instructor-laravel

Statistics

Installs: 44

Dependents: 0

Suggesters: 1

Stars: 0

Open Issues: 0

v2.0.0 2026-03-13 19:49 UTC

This package is auto-updated.

Last update: 2026-03-13 19:49:45 UTC


README

Laravel integration for InstructorPHP.

It provides:

  • Laravel service provider and config
  • Facades for StructuredOutput, Inference, Embeddings, and AgentCtrl
  • Laravel-specific HTTP client and HTTP pool drivers
  • a Laravel-bound CanSendHttpRequests transport implementation
  • testing fakes for facade-based tests
  • Artisan commands for install, smoke-test, and response-model scaffolding

Example

<?php

use App\ResponseModels\PersonData;
use Cognesy\Instructor\Laravel\Facades\StructuredOutput;

$person = StructuredOutput::with(
    messages: 'John Smith is 30 years old',
    responseModel: PersonData::class,
)->get();

Documentation

  • packages/laravel/docs/index.md
  • packages/laravel/CHEATSHEET.md