Symfony bundle integration of nexylan/slack library

Installs: 938 243

Dependents: 0

Suggesters: 7

Security: 0

Stars: 111

Watchers: 6

Forks: 16

Open Issues: 10


v2.3.0 2021-03-31 13:25 UTC

This package is auto-updated.

Last update: 2023-01-29 02:46:12 UTC


Symfony bundle integration of the nexylan/slack library (old popular maknz/slack).

Latest Stable Version Latest Unstable Version License Dependency Status Reference Status

Total Downloads Monthly Downloads Daily Downloads

Build Status Scrutinizer Code Quality Code Climate Coverage Status SensioLabsInsight


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

  • 1.x with support for Symfony >=2.7
  • 2.x with support for Symfony >=3.4


This version of the project requires:

  • PHP 7.1+
  • Symfony 3.4+


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.

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


If it is not already done, you have to configure httplug-bundle first. Check the official documentation for this.

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


    # If you want to use an another httplug client service.
        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.


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

Here is an example:


namespace AppBundle\Controller;

use Nexy\Slack\Attachment;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
    public function indexAction()
        $slack = $this->get('nexy_slack.client');

        $message = $slack->createMessage();

            ->from('John Doe')
            ->setText('This is an amazing message!')

        $message->attach((new Attachment())
             ->setFallback('Some fallback text')
             ->setText('The attachment text')


All the how to manipulate the Slack client is on the nexylan/slack documentation.