Practical overview
When it fits
Use it when a PHP 8.2-or-later Laravel application needs Anthropic API access through Laravel’s facade and service-container patterns.
Who it is for
- Laravel developers adding Anthropic message generation to an application.
- Teams building streamed AI responses or connecting model tool use to application code.
- Developers testing Anthropic integrations with Laravel-style fakes and request assertions.
Documented uses
- Send message requests to Anthropic and use the returned response.
- Stream generated text as response deltas arrive.
- Provide tools for a model to call, execute the requested application logic and return results.
- Create tests that fake API responses and assert requests.
- Access API capabilities including batches, files, citations and token counting through the package.
Requirements & limits
The README specifies PHP 8.2 or later and an Anthropic API key for API use. The repository is public and licensed under MIT.
- The package is Laravel-specific and wraps the community-maintained Anthropic PHP SDK.
- Its facade exposes resources including messages, models, batches, files and completions.
- The install command publishes configuration and adds an API-key entry to
.env. - The included test fake can queue responses and assert sent requests.
- For PHP projects without Laravel, the README points to the framework-agnostic Anthropic PHP package.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install and configure Anthropic Laravel
Add the package to a Laravel application and prepare its Anthropic API key configuration.
Before you start
- A Laravel application
- PHP 8.2 or later
- An API key from the Anthropic Console
Steps
Install the package with Composer using
composer require mozex/anthropic-laravel.Run the command below to publish the configuration and append
ANTHROPIC_API_KEY=to.env.php artisan anthropic:installSet the environment variable to the API key.
Expected outcome
The Laravel application has the package installed and its API key configured for use.
Guide limitations
- This covers package setup and configuration, not an API request or deployment.
- API use depends on an Anthropic API key.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- mozex/anthropic-laravel · Official homepage title · retained in its source language
Related options
Anthropic PHP — The framework-agnostic PHP SDK on which Anthropic Laravel is built; the README points non-Laravel projects to it.

