cognesy / instructor-laravel
Laravel integration for Instructor PHP - Structured LLM outputs made simple
v2.2.0
2026-03-18 23:35 UTC
Requires
- php: ^8.3
- cognesy/agent-ctrl: ^1.22
- cognesy/instructor-config: ^2.2
- cognesy/instructor-events: ^2.2
- cognesy/instructor-http-client: ^2.2
- cognesy/instructor-http-pool: ^2.2
- cognesy/instructor-messages: ^2.2
- cognesy/instructor-polyglot: ^2.2
- cognesy/instructor-struct: ^2.2
- cognesy/instructor-utils: ^2.2
- 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 - native
Cognesy\Agentscontainer bindings, registry loading, and session runtime - database-backed native agent sessions, broadcasting helpers, telemetry wiring, and logging presets
- testing fakes for facade-based tests and Laravel-native helper utilities for native agents
- Artisan commands for install, smoke-test, and response-model scaffolding
The package now treats native Cognesy\\Agents runtime configuration and AgentCtrl
code-agent execution as separate Laravel surfaces:
agentsis reserved for native agent runtime integrationagent_ctrlconfigures CLI code agents exposed through theAgentCtrlfacadetelemetryis the first-class config namespace for Laravel telemetry wiring
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