cognesy / instructor-laravel
Laravel integration for Instructor PHP - Structured LLM outputs made simple
v2.0.0
2026-03-13 19:49 UTC
Requires
- php: ^8.3
- cognesy/agent-ctrl: ^1.22
- cognesy/instructor-config: ^2.0
- cognesy/instructor-events: ^2.0
- cognesy/instructor-http-client: ^2.0
- cognesy/instructor-http-pool: ^2.0
- cognesy/instructor-messages: ^2.0
- cognesy/instructor-polyglot: ^2.0
- cognesy/instructor-struct: ^2.0
- cognesy/instructor-utils: ^2.0
- cognesy/logging: ^1.22
- illuminate/console: ^10.0|^11.0|^12.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
- phpstan/phpstan: ^1.10
README
Laravel integration for InstructorPHP.
It provides:
- Laravel service provider and config
- Facades for
StructuredOutput,Inference,Embeddings, andAgentCtrl - Laravel-specific HTTP client and HTTP pool drivers
- a Laravel-bound
CanSendHttpRequeststransport 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.mdpackages/laravel/CHEATSHEET.md