Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Anthropic Php Laravel Package

mozex/anthropic-php

Community-maintained PHP SDK for the Anthropic API. Send messages, stream responses, call tools, use extended thinking, web search, code execution, files, and batches. PSR-18 compatible, works with any HTTP client; Laravel wrapper available.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • AI-Driven Features: Enables rapid integration of Anthropic’s Claude models into Laravel applications (e.g., chatbots, dynamic content generation, or tool-assisted workflows). Supports roadmap items like "AI-powered customer support" or "automated content summarization."
  • Build vs. Buy: Avoids reinventing a custom Anthropic API wrapper, reducing dev time and maintenance overhead. The package’s forward-compatibility ensures long-term viability without forking.
  • Use Cases:
    • Real-time interactions: Streaming responses for chat interfaces (e.g., live Q&A, collaborative editing).
    • Tool augmentation: Extending Claude’s capabilities with custom tools (e.g., weather APIs, CRM integrations).
    • Batch processing: Asynchronous tasks like document analysis or bulk data generation.
    • Files API: Handling PDFs, images, or code execution outputs (e.g., document processing pipelines).
    • Testing: Mocking API responses for CI/CD or unit tests without external dependencies.

When to Consider This Package

Adopt if:

  • Your Laravel app requires Anthropic API integration (messages, tools, streaming, or files).
  • You need type safety (immutable responses, IDE autocompletion) and minimal boilerplate.
  • Your team prioritizes testability (built-in ClientFake for mocking).
  • You want PSR-18 compatibility (works with Guzzle, Symfony HTTP Client, etc.).
  • You’re using PHP 8.2+ and Laravel (or can abstract the SDK behind a service layer).

Look elsewhere if:

  • You’re locked into a non-PHP stack (e.g., Node.js, Python).
  • You need real-time multiplayer collaboration (consider WebSocket-based solutions).
  • Your use case requires custom model fine-tuning (Anthropic’s API doesn’t support this).
  • You’re constrained by legacy PHP versions (<8.2).
  • You prefer serverless-first SDKs (e.g., AWS Lambda integrations).

How to Pitch It (Stakeholders)

For Executives: *"This PHP SDK lets us integrate Anthropic’s Claude models into our Laravel apps with minimal dev effort. Key benefits:

  • Speed: Ship AI features faster (e.g., chatbots, dynamic content) without building a custom API wrapper.
  • Cost: Avoids reinventing the wheel—maintained by the community, with forward-compatibility for new Anthropic features.
  • Scalability: Handles streaming, batch processing, and tool use for complex workflows (e.g., document analysis, CRM integrations).
  • Reliability: Built-in testing tools and rate-limit tracking reduce operational surprises."*

For Engineering: *"This package gives us:

  • Type safety: Immutable responses with IDE support (no more guessing API fields).
  • Flexibility: Works with any PSR-18 HTTP client (Guzzle, Symfony, etc.)—no vendor lock-in.
  • Testing superpowers: Mock API responses in unit tests without external servers (ClientFake).
  • Future-proofing: Parameters pass through to Anthropic’s API directly, so new features (tools, thinking modes) work the day they’re released.
  • Laravel-friendly: The companion anthropic-laravel package adds service container integration and config-based setup."*

For Developers: *"Pros:

  • Clean syntax: $client->messages()->create([...]) instead of raw HTTP calls.
  • Streaming support: Real-time responses for chat apps or live updates.
  • Tool use: Let Claude call your custom functions (e.g., fetch weather data, query a database).
  • Files API: Upload documents once and reference them in prompts (great for PDFs or code outputs).
  • No fluff: Minimal dependencies, just the SDK and a PSR-18 client (auto-installed via php-http/discovery)."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony