PHPackages                             geggleto/infrastructure - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. geggleto/infrastructure

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

geggleto/infrastructure
=======================

0.0.4(9y ago)321MITPHP

Since Jan 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/geggleto/framework-infrastructure)[ Packagist](https://packagist.org/packages/geggleto/infrastructure)[ RSS](/packages/geggleto-infrastructure/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Command And Event Structure for Slim
====================================

[](#command-and-event-structure-for-slim)

Usage
-----

[](#usage)

In order to take advantage of the Command Bus and Event Bus, you will need to base your Controllers/Actions on the `AbstractAction` object

```
public MyAction extends Infra\AbstractAction implements EventListenerInterface {
    protected $sent;

    public function __construct(CommandBus $bus) {
        parent::__construct($bus);

        $this->sent = false;

        //Register Our Action class as a listener for the SentEmailToUser Event
        $eventBus = $bus->getEventBus();
        $eventBus->addListener(SentEmailToUser::NAME, $this);
        //We are waiting for the domain model to return to us wether the email was sent or not.
        //We do not care about anything else, except whether or not it was successful.
    }

    //In this action we will Queue and Email to be sent.
    public function __invoke(Request $request, Response $response, array $args = []) {
        $this->commandBus->handle(new SendEmailToUser());

        //Return our response
        return $this->respond($response);
    }

    //We received the event mark it as a yes
    public function receiveEvent(SentEmailToUser $event) {
        $this->sent = true;
    }

    public function respond(Response $response) {
        if ($sent) { //Yes we did
            return $response->withJson(['message' => 'Sent Email to User']);
        } else { //No We did not.
            return $response->withJson(['message' => 'Sent Email to User'], 500);
        }
    }

    public function getCommands() {
        return []; //We are not queueing any other commands
    }

    public function getEvents() {
        return []; //We are not queuing any other events
    }
}
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

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

Every ~0 days

Total

4

Last Release

3439d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f941aecd52e3f8ac94dbe9b714801c7adc767acc32644d3ee6a4efeded84c5e?d=identicon)[geggleto](/maintainers/geggleto)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geggleto-infrastructure/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[razorpay/ifsc

Razorpay IFSC Codes Library

385204.4k](/packages/razorpay-ifsc)[anthropic-ai/sdk

Anthropic PHP SDK

160372.1k14](/packages/anthropic-ai-sdk)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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