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.
Download mozex/anthropic-laravel
More information about mozex/anthropic-laravel
Files in mozex/anthropic-laravel
Package anthropic-laravel
Short Description Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API
License MIT
Informations about the package anthropic-laravel
Anthropic Laravel is a community-maintained PHP API client that allows you to interact with the Anthropic API. This package is based on the excellent work of Nuno Maduro and Sandro Gehri.
Note: This repository contains the integration code of the Anthropic PHP for Laravel. If you want to use the Anthropic PHP client in a framework-agnostic way, take a look at the mozex/anthropic-php repository.
Table of Contents
- Support Us
- Get Started
- Configuration
- Usage
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Support us
Creating and maintaining open-source projects requires significant time and effort. Your support will help enhance the project and enable further contributions to the PHP community.
Sponsorship can be made through the GitHub Sponsors program. Just click the "Sponsor" button at the top of this repository. Any amount is greatly appreciated, even a contribution as small as $1 can make a big difference and will go directly towards developing and improving this package.
Thank you for considering sponsoring. Your support truly makes a difference!
Get Started
Requires PHP 8.1+
First, install Anthropic via the Composer package manager:
Next, execute the install command:
This will create a config/anthropic.php
configuration file in your project, which you can modify to your needs
using environment variables.
Blank environment variable for the Anthropic API key is already appended to your .env
file.
Finally, you may use the Anthropic
facade to access the Anthropic API:
Configuration
Configuration is done via environment variables or directly in the configuration file (config/anthropic.php
).
Anthropic API Key
Specify your Anthropic API Key. This will be used to authenticate with the Anthropic API - you can find your API key on your Anthropic dashboard, at https://console.anthropic.com/settings/keys.
Request Timeout
The timeout may be used to specify the maximum number of seconds to wait for a response. By default, the client will time out after 30 seconds.
Usage
For usage examples, take a look at the mozex/anthropic-php repository.
Testing
The Anthropic
facade comes with a fake()
method that allows you to fake the API responses.
The fake responses are returned in the order they are provided to the fake()
method.
All responses are having a fake()
method that allows you to easily create a response object by only providing the parameters relevant for your test case.
After the requests have been sent there are various methods to ensure that the expected requests were sent:
For more testing examples, take a look at the mozex/anthropic-php repository.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Mozex
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of anthropic-laravel with dependencies
guzzlehttp/guzzle Version ^7.9.2
laravel/framework Version ^9.46.0|^10.34.2|^11.23.5
mozex/anthropic-php Version ^v1.1.0