Requirements
Before installing Prism, make sure your project meets these requirements:- PHP 8.2 or higher
- Laravel 11.0 or higher (supports Laravel 11, 12, and 13)
- ext-fileinfo PHP extension
Installation steps
Install via Composer
Add Prism to your Laravel project using Composer:This command will download Prism and its dependencies into your project.
Publish the configuration file
Prism comes with a configuration file that you’ll want to customize. Publish it to your This creates a new file at
config directory:config/prism.php where you can configure your AI providers.Configure your providers
Add your API keys to your See the Configuration page for detailed information about configuring providers.
.env file. Here’s an example for OpenAI:Service provider registration
Prism automatically registers its service provider through Laravel’s package discovery. ThePrismServiceProvider is registered automatically, so you don’t need to add it manually.
What gets registered
The service provider registers:- Prism instance: Available via the
prism()helper function orPrismfacade - Prism manager: Handles provider resolution and configuration
- Prism server: Optional MCP server functionality (disabled by default)
Facade and helper
Prism provides two convenient ways to access its functionality:Using the facade
Using the helper function
Next steps
Quickstart
Build your first AI-powered feature with Prism
Configuration
Learn how to configure providers and customize Prism
Text generation
Explore text generation capabilities in depth
Providers
Discover all supported AI providers