Installation
Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x
- A valid API key from a supported LLM provider
Install via Composer
Publish Configuration
Publish the configuration file to customize settings:config/instructor.php with all available options.
Configure API Keys
Add your LLM provider API key to.env:
Verify Installation
Run the installation command to verify everything is configured correctly:- Publish the configuration if not already published
- Check for API key configuration
- Show next steps
Test Your Connection
Test that your API configuration is working:Optional: Publish Stubs
If you want to customize the response model stubs:stubs/instructor/ in your application.
Manual Registration (Optional)
If you’ve disabled auto-discovery, manually register the service provider inconfig/app.php:
Upgrading
When upgrading to a new version, republish the configuration if there are new options:Next Steps
- Configuration - Configure connections and settings
- Facades - Learn how to use the facades
- Response Models - Create your first response model