Download the PHP package mozex/anthropic-laravel without Composer

On this page you can find all versions of the php package mozex/anthropic-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package anthropic-laravel

Anthropic Laravel

Latest Version on Packagist GitHub Checks Workflow Status Docs License Total Downloads

Laravel wrapper for Anthropic PHP, the community-maintained PHP SDK for the Anthropic API. Adds a Facade, a publishable config, an install command, and a testing integration that plugs into the service container.

Read the full documentation at mozex.dev: searchable docs, version requirements, detailed changelog, and more.

Not using Laravel? Use the framework-agnostic Anthropic PHP package directly.

Table of Contents

Support This Project

I maintain this package along with several other open-source PHP packages used by thousands of developers every day.

If my packages save you time or help your business, consider sponsoring my work on GitHub Sponsors. Your support lets me keep these packages updated, respond to issues quickly, and ship new features.

Business sponsors get logo placement in package READMEs. See sponsorship tiers →

Why This Package

Anthropic:: Facade for everything. Anthropic::messages(), Anthropic::models(), Anthropic::batches(), Anthropic::files(), Anthropic::completions(). No client instantiation, no factory setup. The service provider handles it.

Anthropic::fake() in your tests. Swap the real client with a fake, queue responses, and assert exactly which requests were sent. Pairs with Laravel's existing testing idioms like Event::fake() and Queue::fake(). See the testing docs →

One artisan command to set up. php artisan anthropic:install publishes the config file and appends ANTHROPIC_API_KEY= to your .env. You're ready to go.

Forward-compatible. Parameters pass through to the API as-is. When Anthropic ships a new feature, it works in your code the same day. No waiting for a package update.

Full Anthropic API coverage. Messages, streaming, tool use, extended thinking, web search, code execution, citations, token counting, and batch processing. Every feature the API supports is available through the Facade.

Installation

Requires PHP 8.2+ - see all version requirements

Run the install command:

This publishes config/anthropic.php and appends ANTHROPIC_API_KEY= to your .env. Set your key from the Anthropic Console:

Quick Start

Use the Anthropic Facade anywhere in your app:

Streaming

Print text as it arrives:

Tool Use

Give Claude tools to call, execute them in your code, send results back:

Extended Thinking

Let Claude reason through complex problems before answering:

The full documentation covers every feature: vision and images, web search and code execution, document citations, batch processing, error handling, testing, and more.

Resources

Visit the documentation site for searchable docs auto-updated from this repository.

License

The MIT License (MIT). Please see License File for more information.


All versions of anthropic-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
guzzlehttp/guzzle Version ^7.9.3
laravel/framework Version ^11.29|^12.12|^13.0
mozex/anthropic-php Version ^1.8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mozex/anthropic-laravel contains the following files

Loading the files please wait ...