PHPackages                             nexylan/slack-bundle - 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. nexylan/slack-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

nexylan/slack-bundle
====================

Symfony bundle integration of nexylan/slack library

v2.3.0(5y ago)1081.2M↓13.7%22[8 issues](https://github.com/nexylan/slack-bundle/issues)[1 PRs](https://github.com/nexylan/slack-bundle/pulls)MITPHPPHP ^7.4 || ^8.0

Since Mar 7Pushed 3y ago5 watchersCompare

[ Source](https://github.com/nexylan/slack-bundle)[ Packagist](https://packagist.org/packages/nexylan/slack-bundle)[ RSS](/packages/nexylan-slack-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (11)Versions (14)Used By (0)

NexySlackBundle
===============

[](#nexyslackbundle)

Symfony bundle integration of the [nexylan/slack](https://github.com/nexylan/slack) library (old popular `maknz/slack`).

[![Latest Stable Version](https://camo.githubusercontent.com/5fbd2bcfc1478deb12587c2a5e21d96ad6657a64a18cec378d2b14d5aa7e02d2/68747470733a2f2f706f7365722e707567782e6f72672f6e6578796c616e2f736c61636b2d62756e646c652f762f737461626c65)](https://packagist.org/packages/nexylan/slack-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/0d1441acfb013e5747b72e3a5bb5189ee4bbb591b8958a08f38fd924ed63b8c7/68747470733a2f2f706f7365722e707567782e6f72672f6e6578796c616e2f736c61636b2d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/nexylan/slack-bundle)[![License](https://camo.githubusercontent.com/a08768e8f333e2f87c36826277deb2cfcbe0dcbf609272ec4d66727358665d0e/68747470733a2f2f706f7365722e707567782e6f72672f6e6578796c616e2f736c61636b2d62756e646c652f6c6963656e7365)](https://packagist.org/packages/nexylan/slack-bundle)[![Dependency Status](https://camo.githubusercontent.com/257ee539323fc26413b50a77e0bc1e0f8e656b5ac4e33756ac2b3be21900c3b2/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6e6578796c616e3a736c61636b2d62756e646c652f62616467652e737667)](https://www.versioneye.com/php/nexylan:slack-bundle)[![Reference Status](https://camo.githubusercontent.com/332b1d53b6e76d4da92572f4005c53662dc718c4c7da9b8d326e8b54d496e493/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6e6578796c616e3a736c61636b2d62756e646c652f7265666572656e63655f62616467652e737667)](https://www.versioneye.com/php/nexylan:slack-bundle/references)

[![Total Downloads](https://camo.githubusercontent.com/88ce4bd170283a9eee5d37c19f02b3e567e9127c678e1f608a3304717ec33c56/68747470733a2f2f706f7365722e707567782e6f72672f6e6578796c616e2f736c61636b2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/nexylan/slack-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/beec2aa6d7a9bf29e82c25e7d93e11fd3fe6089f375898f15124109d87dcfcda/68747470733a2f2f706f7365722e707567782e6f72672f6e6578796c616e2f736c61636b2d62756e646c652f642f6d6f6e74686c79)](https://packagist.org/packages/nexylan/slack-bundle)[![Daily Downloads](https://camo.githubusercontent.com/96bbf378b7ed93a35ec14f6279e895cf9e026b82bdd315d2710e4be50d020fd6/68747470733a2f2f706f7365722e707567782e6f72672f6e6578796c616e2f736c61636b2d62756e646c652f642f6461696c79)](https://packagist.org/packages/nexylan/slack-bundle)

[![Build Status](https://camo.githubusercontent.com/3d49fabfb874477668162940a1bb70bcac2040835744cdbb1119a54e886ef6b4/68747470733a2f2f7472617669732d63692e6f72672f6e6578796c616e2f4e657879536c61636b42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nexylan/NexySlackBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/565871fea3fd49338bc782d32cea456ee8cb8f51d2b3f560af0301bbd678dde2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e6578796c616e2f4e657879536c61636b42756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/nexylan/NexySlackBundle/?branch=master)[![Code Climate](https://camo.githubusercontent.com/2183b35c2ac4ff4ab349e59453e1c8e0d616e537ca30afb3d77d017ebdb801ae/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6578796c616e2f4e657879536c61636b42756e646c652f6261646765732f6770612e737667)](https://codeclimate.com/github/nexylan/NexySlackBundle)[![Coverage Status](https://camo.githubusercontent.com/78534bf45ab0fe2e188a48f6590236f1f74d88c1788c4da7ad13260733de04e7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6e6578796c616e2f4e657879536c61636b42756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/nexylan/NexySlackBundle?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/1d71bc2416b0184bdd69cb971c1c14d0388d7e8b98fcdb693a83a1c003393784/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31356532636665642d636662382d343835362d616330642d3932373638666330633332342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/8a6b5dd0-e974-478c-92ee-43125cb7bae3)

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

[](#documentation)

All the installation and usage instructions are located in this README. Check it for specific version:

- [**1.x**](https://github.com/nexylan/NexySlackBundle/tree/1.x) with support for Symfony `>=2.7`
- [**2.x**](https://github.com/nexylan/NexySlackBundle/tree/master) with support for Symfony `>=3.4`

Prerequisites
-------------

[](#prerequisites)

This version of the project requires:

- PHP 7.1+
- Symfony 3.4+

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

[](#installation)

First of all, you need to require this library through composer:

```
$ composer require nexylan/slack-bundle php-http/guzzle6-adapter
```

Why `php-http/guzzle6-adapter`? We are decoupled from any HTTP messaging client thanks to [HTTPlug](http://httplug.io/).

Then, enable the bundle on the `AppKernel` class:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Http\HttplugBundle\HttplugBundle(),
        new Nexy\SlackBundle\NexySlackBundle(),
    );

    // ...

    return $bundles
}
```

Configuration
-------------

[](#configuration)

If it is not already done, you have to configure httplug-bundle first. Check the [official documentation](http://docs.php-http.org/en/latest/integrations/symfony-bundle.html) for this.

Configure the bundle to your needs (example with default values):

```
nexy_slack:

    # If you want to use an another httplug client service.
    http:
        client: httplug.client

    # The Slack API Incoming WebHooks URL.
    endpoint:             ~ # Required
    channel:              null
    username:             null
    icon:                 null
    link_names:           false
    unfurl_links:         false
    unfurl_media:         true
    allow_markdown:       true
    markdown_in_attachments: []
```

Excepted `endpoint`, all the other configuration keys are related to the Slack client default settings.

All those settings are described on the [nexylan/slack documentation](https://github.com/nexylan/slack#settings).

Usage
-----

[](#usage)

The Slack client instance can be retrieved from the `nexy_slack.client` service.

Here is an example:

```
