PHPackages                             raid/caller - 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. raid/caller

ActiveLibrary

raid/caller
===========

Raid Caller Package

v1.0.0(7mo ago)04MITPHPPHP ^8.2

Since Oct 10Pushed 7mo agoCompare

[ Source](https://github.com/0xKhdr/caller)[ Packagist](https://packagist.org/packages/raid/caller)[ RSS](/packages/raid-caller/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Raid Caller Package
===================

[](#raid-caller-package)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Laravel](https://camo.githubusercontent.com/f0c00b70c86a12b92378436817e8d7b9b7b7834b7d61356c9a7d3e90cc9e082d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d392532422d6f72616e67652e737667)](https://laravel.com/)

A modular, testable, and maintainable package for encapsulating outbound HTTP calls in Laravel. Raid Caller enforces a clean separation of concerns for HTTP requests, making your codebase more robust and easier to extend.

Features
--------

[](#features)

- **Separation of concerns:** Caller (intent), Service (execution), Receiver (parsing), DTO (domain model)
- **Immutable DTOs:** Safe, readonly data transfer objects
- **Extensible:** Easy to add new endpoints and customize behavior
- **Testable:** Works seamlessly with Laravel HTTP fakes

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

[](#installation)

```
composer require raid/caller
```

- Compatible with Laravel 9+
- The service provider `Raid\\Caller\\Providers\\CallerServiceProvider` is auto-discovered. If not, register it manually.
- To publish the config (if available):

```
php artisan vendor:publish --tag=caller
```

Quick Start
-----------

[](#quick-start)

Here's a minimal example for making a GET request:

```
readonly class GetUsersCaller extends \Raid\Caller\Callers\GetCaller {
    public function getUrl(): string { return 'https://api.example.com/users'; }
    public function getReceiver(): string { return GetUsersReceiver::class; }
}

readonly class GetUsersReceiver extends \Raid\Caller\Receivers\ResponseReceiver {
    public function __construct(protected int $status, protected array $users) {}
    public static function fromResponse(\Illuminate\Http\Client\Response $r): static {
        return new static(status: $r->status(), users: array_map(fn(array $u) => UserDto::fromArray($u), $r->json()));
    }
    public function toSuccessResponse(): array { return ['message' => 'Users fetched', 'data' => array_map(fn(UserDto $u) => $u->toArray(), $this->users)]; }
    public function toErrorResponse(): array { return ['message' => 'Failed to fetch users']; }
}
```

Concepts
--------

[](#concepts)

- **Callers:** Define HTTP method, URL, options, and receiver. ([Docs](./docs/02-callers.md))
- **Receivers:** Parse responses and shape output. ([Docs](./docs/03-receivers.md))
- **DTOs:** Immutable data models. ([Docs](./docs/04-dtos.md))
- **Service:** Orchestrates execution and extension points. ([Docs](./docs/05-services.md))
- **Traits &amp; Provider:** Utilities and configuration. ([Docs](./docs/06-traits.md), [Docs](./docs/07-providers.md))

See the [Overview](./docs/00-overview.md) for a high-level map.

Lifecycle
---------

[](#lifecycle)

See [Lifecycle](./docs/01-lifecycle.md) for a summary and sequence diagram.

Advanced Usage
--------------

[](#advanced-usage)

- Customize options, headers, and caching in Callers
- Extend Receivers for custom response handling
- Add new DTOs for your domain models

Testing
-------

[](#testing)

Use Laravel HTTP fakes to test Callers and Receivers in isolation. See [Testing](./docs/08-testing.md).

Observability &amp; Conventions
-------------------------------

[](#observability--conventions)

- Logging, correlation, and metrics are supported. See [Observability](./docs/09-observability.md).
- Coding norms and best practices: [Conventions](./docs/10-conventions.md).

Contributing
------------

[](#contributing)

Contributions are welcome! Please open issues or submit pull requests.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Roadmap
-------

[](#roadmap)

See [Roadmap](./docs/11-roadmap.md) for planned features and improvements.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](../../CHANGELOG.md) for release history.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance64

Regular maintenance activity

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

220d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f70f41f51a4ac47d17d99a5b2207cbab2e9fbffb185e3bac694ca76a55b7074d?d=identicon)[MohamedKhedr700](/maintainers/MohamedKhedr700)

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/raid-caller/health.svg)

```
[![Health](https://phpackages.com/badges/raid-caller/health.svg)](https://phpackages.com/packages/raid-caller)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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