PHPackages                             hassanelzarkawy/nactu - 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. [CLI &amp; Console](/categories/cli)
4. /
5. hassanelzarkawy/nactu

ActiveLibrary[CLI &amp; Console](/categories/cli)

hassanelzarkawy/nactu
=====================

A Command Bus implementation with middleware pipeline, query caching, and retry support for Laravel

0.0.1(1mo ago)08MITPHPPHP ^8.4CI passing

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/HassanElZarkawy/nactu)[ Packagist](https://packagist.org/packages/hassanelzarkawy/nactu)[ RSS](/packages/hassanelzarkawy-nactu/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Nactu
=====

[](#nactu)

A lightweight CQRS package for Laravel with command/query bus, middleware pipeline, query caching, and retry support.

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 11+

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

[](#installation)

```
composer require hassanelzarkawy/nactu
```

Publish the config file:

```
php artisan vendor:publish --tag=nactu-config
```

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

[](#quick-start)

### Commands (Write)

[](#commands-write)

Create a command and its handler:

```
php artisan make:command CreateUser
```

This generates:

- `App\Commands\CreateUserCommand`
- `App\Handlers\CreateUserHandler`

Dispatch it:

```
use Nactu\CommandBusInterface;

public function store(CommandBusInterface $bus): void
{
    $bus->dispatch(new CreateUserCommand(
        name: 'Hassan',
        email: 'hassan@example.com',
    ));
}
```

### Queries (Read)

[](#queries-read)

Create a query and its handler:

```
php artisan make:query ListUsers
```

This generates:

- `App\Queries\ListUsersQuery`
- `App\QueryHandlers\ListUsersHandler`

Dispatch it:

```
use Nactu\QueryBusInterface;

public function index(QueryBusInterface $bus): JsonResponse
{
    $users = $bus->dispatch(new ListUsersQuery(
        status: 'active',
    ));

    return response()->json($users);
}
```

Documentation
-------------

[](#documentation)

- [Commands](docs/commands.md) — Command bus, handlers, and write operations
- [Queries](docs/queries.md) — Query bus, cacheable queries, and read operations
- [Middleware](docs/middleware.md) — Built-in and custom middleware
- [Caching](docs/caching.md) — Query caching, cache keys, and invalidation
- [Auto-Discovery](docs/auto-discovery.md) — Convention-based handler resolution
- [Console Commands](docs/console-commands.md) — Code generation commands
- [Configuration](docs/configuration.md) — Full config reference

How It Works
------------

[](#how-it-works)

```
CommandBus (writes)          QueryBus (reads)
     │                            │
     ├─ Retry Middleware          ├─ Cache Middleware
     ├─ Performance Monitor       ├─ Performance Monitor
     │                            │
     └─► Handler                  └─► Handler

```

Commands and queries have separate middleware stacks. Commands get retry support, queries get caching — no overlap.

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance88

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8324534bbbd22916cc050f64bdc0e9c6616a7fc1da8354e43f00c409ce584228?d=identicon)[HassanElZarkawy](/maintainers/HassanElZarkawy)

---

Top Contributors

[![HassanElZarkawy](https://avatars.githubusercontent.com/u/12422569?v=4)](https://github.com/HassanElZarkawy "HassanElZarkawy (8 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/hassanelzarkawy-nactu/health.svg)

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

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[illuminate/console

The Illuminate Console package.

13046.0M6.8k](/packages/illuminate-console)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[illuminate/filesystem

The Illuminate Filesystem package.

15265.2M3.3k](/packages/illuminate-filesystem)[moonshine/moonshine

Laravel administration panel

1.3k253.1k86](/packages/moonshine-moonshine)

PHPackages © 2026

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