PHPackages                             blockshiftnetwork/composio-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. blockshiftnetwork/composio-laravel

ActiveLibrary[Framework](/categories/framework)

blockshiftnetwork/composio-laravel
==================================

Laravel integration for Composio with PrismPHP and Laravel AI tool support

v1.1.1(1mo ago)010MITPHPPHP ^8.3CI passing

Since Mar 30Pushed 1mo agoCompare

[ Source](https://github.com/blockshiftnetwork/composio-laravel)[ Packagist](https://packagist.org/packages/blockshiftnetwork/composio-laravel)[ RSS](/packages/blockshiftnetwork-composio-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (22)Versions (10)Used By (0)

Composio Laravel
================

[](#composio-laravel)

Laravel integration for Composio PHP v1 with first-class PrismPHP and Laravel AI tool support.

This package follows the current Composio TypeScript shape where possible:

- `Composio::create($userId, $config)` creates a Tool Router session.
- `Composio::use($sessionId)` resumes a Tool Router session.
- `Composio::tools($userId)` exposes direct tools for PrismPHP or Laravel AI.
- Connected accounts, auth configs, toolkits, triggers, MCP and files remain available through dedicated managers.

Legacy `toolSet()` and `entityId` APIs are intentionally not part of the v1 surface.

Installation
------------

[](#installation)

```
composer require blockshiftnetwork/composio-laravel
```

PrismPHP and Laravel AI are optional. Install only the adapter you use:

```
composer require prism-php/prism
composer require laravel/ai
```

```
COMPOSIO_API_KEY=your-api-key
COMPOSIO_BASE_URL=https://backend.composio.dev
```

Create A Tool Router Session
----------------------------

[](#create-a-tool-router-session)

```
use BlockshiftNetwork\ComposioLaravel\Facades\Composio;

$session = Composio::create('user_123', [
    'toolkits' => ['github', 'slack'],
    'tools' => [
        'github' => ['GITHUB_CREATE_ISSUE', 'GITHUB_LIST_REPOS'],
        'slack' => ['SLACK_SEND_MESSAGE'],
    ],
    'manageConnections' => [
        'enable' => true,
        'callbackUrl' => route('composio.callback'),
        'inferScopesFromTools' => true,
    ],
]);

$session->sessionId;
$session->mcp;
```

The config builder accepts TypeScript-style keys and sends the v1 Tool Router payload (`user_id`, `toolkits`, `tools`, `auth_configs`, `connected_accounts`, `manage_connections`, `workbench`, `preload`, `multi_account`).

Use Session Tools With PrismPHP
-------------------------------

[](#use-session-tools-with-prismphp)

```
$session = Composio::use('session_123');

$tools = $session->tools();

$result = $session->execute('GITHUB_CREATE_ISSUE', [
    'owner' => 'acme',
    'repo' => 'api',
    'title' => 'Bug from agent',
]);
```

Use Session Tools With Laravel AI
---------------------------------

[](#use-session-tools-with-laravel-ai)

```
$session = Composio::use('session_123');

$tools = $session->laravelAiTools();
```

Both provider adapters execute through the session router, so tool calls respect the session configuration and connection management.

Authorize A Toolkit
-------------------

[](#authorize-a-toolkit)

```
$link = $session->authorize('github', route('composio.callback'));

$link->getRedirectUrl();
$link->getConnectedAccountId();
```

Direct Tools
------------

[](#direct-tools)

Use direct tools when you already know the user or connected account and do not need a Tool Router session.

```
$tools = Composio::tools('user_123')
    ->withConnectedAccount('ca_123')
    ->get('github', ['GITHUB_CREATE_ISSUE'], ['issues']);

$result = Composio::tools('user_123')
    ->withConnectedAccount('ca_123')
    ->execute('GITHUB_CREATE_ISSUE', [
        'owner' => 'acme',
        'repo' => 'api',
        'title' => 'Bug from Laravel',
    ]);
```

Laravel AI direct tools:

```
$tools = Composio::tools('user_123')
    ->withConnectedAccount('ca_123')
    ->getLaravelAiTools('github');
```

Direct Tools Preset
-------------------

[](#direct-tools-preset)

For a TypeScript-compatible direct-tools session:

```
$session = Composio::create('user_123', [
    'sessionPreset' => 'direct_tools',
    'toolkits' => ['github'],
]);
```

This sets:

- `search.enable = false`
- `execute.enable_multi_execute = false`

Custom Tools
------------

[](#custom-tools)

Custom PHP tools are exposed alongside direct Composio tools.

```
Composio::customTools()->register(
    slug: 'LOCAL_PING',
    description: 'Return pong',
    inputSchema: [],
    handler: fn (array $args) => json_encode(['pong' => true]),
);

$tools = Composio::tools()->get();
```

Hooks
-----

[](#hooks)

```
$tools = Composio::tools('user_123');

$tools->hooks()->beforeExecute('*', function (string $tool, array $arguments): array {
    $arguments['source'] = 'laravel';

    return $arguments;
});
```

Managers
--------

[](#managers)

```
Composio::connectedAccounts();
Composio::authConfigs();
Composio::toolkits();
Composio::triggers();
Composio::mcp();
Composio::files();
```

SDK Coverage Notes
------------------

[](#sdk-coverage-notes)

The package uses `blockshiftnetwork/composio-php` v1 as the transport layer. Tool Router create, resume, toolkit listing, toolkit authorization and session execution are implemented directly. Methods that exist in the TypeScript SDK but are not generated by the PHP SDK yet, such as session search/update/proxy execution, throw an explicit `ComposioException` instead of silently doing the wrong thing.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance91

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

5

Last Release

42d ago

Major Versions

v0.0.2 → v1.0.02026-05-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/13807d18c3251d3f5b8eebf5341dc03d273dbf17ddc159203ee76333133f1ec1?d=identicon)[alexr1712](/maintainers/alexr1712)

---

Top Contributors

[![AlexR1712](https://avatars.githubusercontent.com/u/8460736?v=4)](https://github.com/AlexR1712 "AlexR1712 (10 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/blockshiftnetwork-composio-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/blockshiftnetwork-composio-laravel/health.svg)](https://phpackages.com/packages/blockshiftnetwork-composio-laravel)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M833](/packages/laravel-socialite)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k17.6M515](/packages/laravel-boost)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M162](/packages/laravel-ai)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
