Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MohamedElsaed's avatar

MohamedElsaed wrote a reply+100 XP

2mos ago

Check and tell me

MohamedElsaed's avatar

MohamedElsaed started a new conversation+100 XP

2mos ago

Hey Laracasters,

I just published a Laravel package that wraps the Claude Code CLI as a library. It gives you a fluent PHP API for building AI agents with file operations, bash commands, code editing, subagents, MCP servers, and structured output.

Quick example:

use ClaudeAgentSDK\Facades\ClaudeAgent;
use ClaudeAgentSDK\Options\ClaudeAgentOptions;

$options = ClaudeAgentOptions::make()
    ->tools(['Read', 'Edit', 'Bash'])
    ->permission('acceptEdits')
    ->maxTurns(10);

$result = ClaudeAgent::query('Find bugs in the User model', $options);
echo $result->text();

Features: streaming, subagents, MCP servers, JSON schema output, session resume/fork.

Supports PHP 8.1+ and Laravel 10/11/12.

Install: composer require mohamed-ashraf-elsaed/claude-agent-sdk-laravel

GitHub: https://github.com/mohamed-ashraf-elsaed/claude-agent-sdk-laravel Docs: https://github.com/mohamed-ashraf-elsaed/claude-agent-sdk-laravel/wiki

Would appreciate any feedback on the API design or feature suggestions.