krenor/skippy

A library for sending AMQP messages to queues or exchanges with Laravel/Lumen
Install
composer require krenor/skippy:dev-master
PHP:>=7.0
License:MIT
Last Updated:Dec 20, 2016
Links: GitHub  ·  Packagist
Maintainer: Krenor

Skippy - The lightweight PHP AMQP Messager

Getting started

Installation

You can install this package via composer using this command:

composer require krenor/skippy

Laravel 5.2+

  1. Register the Service Provider
// config/app.php
'providers' => [
    ...
    Skippy\Providers\SkippyServiceProvider::class,
]
  1. Publish the basic configuration

php artisan vendor:publish --provider="Skippy\Providers\SkippyServiceProvider"

  1. Register an alias (optional)
// config/app.php
'aliases' => [
    ...
    'Skippy'   => Skippy\Facades\Skippy::class,
],

Lumen 5.2+

  1. Register the Service Provider
// bootstrap/app.php
$app->register(Skippy\Providers\SkippyServiceProvider::class);
  1. Add a configuration file at config/skippy.php

You can copy the content of the base configuration file and adjust it to your needs.

  1. Register the configuration to be loaded
// bootstrap/app.php
$app->configure('skippy');
  1. Register an alias (optional)
// bootstrap/app.php
class_alias(Skippy\Skippy::class, 'Skippy');

Examples

$profile = $this->createMagicalProfile();

$message = [
    'id'      => Uuid::generate(4)->string,
    'cids'    => [
        Uuid::generate(4)->string,
    ],
    'type'    => 'new-magical-profile',
    'version' => '1.0.0',
    'body'    => $profile,
];

Skippy::send($message)->publish('magical-profile-created');

Contributing

Pull Requests

  • PSR-2 Coding Standard

  • Document any changes - Make sure the README.md and any other relevant documentation are kept up-to-date.

  • Create feature branches - Use git checkout -b my-new-feature

  • One pull request per feature - If you want to do more than one thing, send multiple pull requests.

  • Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

License

skippy is distributed under the terms of the MIT license

Related Packages

dojiland/amqp-laravel

PHP RabbitMQ client for Laravel && Lumen

713 3
ose1955/rabbitmq-client

Laravel/Lumen Async and DirectRpc interfaces for RabbitMQ using AMQP.

13 0
comlaude/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

17,652 4
kamiorz/lumen-amqp

AMQP wrapper for Lumen to publish and consume messages

26 0
butschster/lumen-microservice

This Package will help you to use Lumen framework as a microservice with AMQP an...

767 5