2017 © Pedro Peláez
 

library exception-to-slack-attachments

Format PHP Exception to Slack Attachments array for alek13/slack.

image

ariarijp/exception-to-slack-attachments

Format PHP Exception to Slack Attachments array for alek13/slack.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 12 % Grown

The README.md

exception-to-slack-attachments

Format PHP Exception to Slack Attachments array for alek13/slack., (*1)

Circle CI, (*2)

Requirements

PHP 5.6+ is required., (*3)

Installation

Add these lines to your composer.json., (*4)

"require": {
    "ariarijp/exception-to-slack-attachments": "0.1.0"
}

Usage example

<?php

require_once __DIR__ . '/vendor/autoload.php';

use ExceptionToSlackAttachments\ExceptionToSlackAttachments;
use Maknz\Slack;

try {
    throw new \Exception('Something went wrong');
} catch (\Exception $e) {
    $attachments = ExceptionToSlackAttachments::toAttachments($e);

    $client = new Slack\Client('http://your.slack.endpoint');
    $client->to('#general')
        ->attach($attachments)
        ->send();
}

Run above code, then you will receive message like below., (*5)

example, (*6)

License

MIT, (*7)

Author

ariarijp, (*8)

The Versions

22/03 2018

dev-master

9999999-dev https://github.com/ariarijp/exception-to-slack-attachments

Format PHP Exception to Slack Attachments array for alek13/slack.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

22/03 2018

0.1.0

0.1.0.0 https://github.com/ariarijp/exception-to-slack-attachments

Format PHP Exception to Slack Attachments array for alek13/slack.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires