经 AI Skill Hub 精选评估,人族Laravel集成 获评「推荐使用」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
Laravel集成Anthropic API,提供Facade、配置发布和安装
人族Laravel集成 是一款基于 PHP 开发的开源工具,专注于 AI、Anthropic、API客户端 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Laravel集成Anthropic API,提供Facade、配置发布和安装
人族Laravel集成 是一款基于 PHP 开发的开源工具,专注于 AI、Anthropic、API客户端 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 克隆仓库 git clone https://github.com/mozex/anthropic-laravel cd anthropic-laravel # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 anthropic-laravel --help # 基本运行 anthropic-laravel [options] <input> # 详细使用说明请查阅文档 # https://github.com/mozex/anthropic-laravel
# anthropic-laravel 配置说明 # 查看配置选项 anthropic-laravel --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export ANTHROPIC_LARAVEL_CONFIG="/path/to/config.yml"
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.
Requires PHP 8.2+ - see all version requirements
composer require mozex/anthropic-laravel
Run the install command:
php artisan anthropic:install
This publishes config/anthropic.php and appends ANTHROPIC_API_KEY= to your .env. Set your key from the Anthropic Console:
ANTHROPIC_API_KEY=sk-ant-...
Use the Anthropic Facade anywhere in your app:
use Anthropic\Laravel\Facades\Anthropic;
$response = Anthropic::messages()->create([
'model' => 'claude-sonnet-4-6',
'max_tokens' => 1024,
'messages' => [
['role' => 'user', 'content' => 'Hello!'],
],
]);
echo $response->content[0]->text; // Hello! How can I assist you today?
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 →
use Anthropic\Laravel\Facades\Anthropic;
use Anthropic\Resources\Messages;
use Anthropic\Responses\Messages\CreateResponse;
Anthropic::fake([
CreateResponse::fake([
'content' => [['type' => 'text', 'text' => 'Paris is the capital of France.']],
]),
]);
// Run your code...
Anthropic::assertSent(Messages::class, function (string $method, array $parameters) {
return $parameters['model'] === 'claude-sonnet-4-6';
});
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.
高质量的Laravel集成,易于使用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:人族Laravel集成 的核心功能完整,质量良好。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | anthropic-laravel |
| Topics | AIAnthropicAPI客户端ClaudeFacade |
| GitHub | https://github.com/mozex/anthropic-laravel |
| License | MIT |
| 语言 | PHP |
收录时间:2026-05-27 · 更新时间:2026-05-27 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。