{"id":15021928,"url":"https://github.com/nexylan/slack-bundle","last_synced_at":"2025-04-05T08:09:01.348Z","repository":{"id":47718591,"uuid":"52890296","full_name":"nexylan/slack-bundle","owner":"nexylan","description":"Symfony bundle integration of the nexylan/slack library.","archived":false,"fork":false,"pushed_at":"2022-11-26T13:13:15.000Z","size":70,"stargazers_count":108,"open_issues_count":10,"forks_count":22,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T07:09:02.747Z","etag":null,"topics":["slack","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://github.com/nexylan/slack","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nexylan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-01T16:05:16.000Z","updated_at":"2025-01-23T18:44:19.000Z","dependencies_parsed_at":"2023-01-22T07:00:12.455Z","dependency_job_id":null,"html_url":"https://github.com/nexylan/slack-bundle","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexylan%2Fslack-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexylan%2Fslack-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexylan%2Fslack-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexylan%2Fslack-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexylan","download_url":"https://codeload.github.com/nexylan/slack-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305935,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["slack","symfony","symfony-bundle"],"created_at":"2024-09-24T19:57:13.821Z","updated_at":"2025-04-05T08:09:01.317Z","avatar_url":"https://github.com/nexylan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NexySlackBundle\n\nSymfony bundle integration of the [nexylan/slack](https://github.com/nexylan/slack) library (old popular `maknz/slack`).\n\n[![Latest Stable Version](https://poser.pugx.org/nexylan/slack-bundle/v/stable)](https://packagist.org/packages/nexylan/slack-bundle)\n[![Latest Unstable Version](https://poser.pugx.org/nexylan/slack-bundle/v/unstable)](https://packagist.org/packages/nexylan/slack-bundle)\n[![License](https://poser.pugx.org/nexylan/slack-bundle/license)](https://packagist.org/packages/nexylan/slack-bundle)\n[![Dependency Status](https://www.versioneye.com/php/nexylan:slack-bundle/badge.svg)](https://www.versioneye.com/php/nexylan:slack-bundle)\n[![Reference Status](https://www.versioneye.com/php/nexylan:slack-bundle/reference_badge.svg)](https://www.versioneye.com/php/nexylan:slack-bundle/references)\n\n[![Total Downloads](https://poser.pugx.org/nexylan/slack-bundle/downloads)](https://packagist.org/packages/nexylan/slack-bundle)\n[![Monthly Downloads](https://poser.pugx.org/nexylan/slack-bundle/d/monthly)](https://packagist.org/packages/nexylan/slack-bundle)\n[![Daily Downloads](https://poser.pugx.org/nexylan/slack-bundle/d/daily)](https://packagist.org/packages/nexylan/slack-bundle)\n\n[![Build Status](https://travis-ci.org/nexylan/NexySlackBundle.svg?branch=master)](https://travis-ci.org/nexylan/NexySlackBundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nexylan/NexySlackBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nexylan/NexySlackBundle/?branch=master)\n[![Code Climate](https://codeclimate.com/github/nexylan/NexySlackBundle/badges/gpa.svg)](https://codeclimate.com/github/nexylan/NexySlackBundle)\n[![Coverage Status](https://coveralls.io/repos/nexylan/NexySlackBundle/badge.svg?branch=master)](https://coveralls.io/r/nexylan/NexySlackBundle?branch=master)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/15e2cfed-cfb8-4856-ac0d-92768fc0c324/mini.png)](https://insight.sensiolabs.com/projects/8a6b5dd0-e974-478c-92ee-43125cb7bae3)\n\n## Documentation\n\nAll the installation and usage instructions are located in this README.\nCheck it for specific version:\n\n* [__1.x__](https://github.com/nexylan/NexySlackBundle/tree/1.x) with support for Symfony `\u003e=2.7`\n* [__2.x__](https://github.com/nexylan/NexySlackBundle/tree/master) with support for Symfony `\u003e=3.4`\n\n## Prerequisites\n\nThis version of the project requires:\n\n* PHP 7.1+\n* Symfony 3.4+\n\n## Installation\n\nFirst of all, you need to require this library through composer:\n\n``` bash\n$ composer require nexylan/slack-bundle php-http/guzzle6-adapter\n```\n\nWhy `php-http/guzzle6-adapter`? We are decoupled from any HTTP messaging client thanks to [HTTPlug](http://httplug.io/).\n\nThen, enable the bundle on the `AppKernel` class:\n\n``` php\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new Http\\HttplugBundle\\HttplugBundle(),\n        new Nexy\\SlackBundle\\NexySlackBundle(),\n    );\n\n    // ...\n\n    return $bundles\n}\n```\n\n## Configuration\n\nIf it is not already done, you have to configure httplug-bundle first.\nCheck the [official documentation](http://docs.php-http.org/en/latest/integrations/symfony-bundle.html) for this.\n\nConfigure the bundle to your needs (example with default values):\n\n```yaml\nnexy_slack:\n\n    # If you want to use an another httplug client service.\n    http:\n        client: httplug.client\n\n    # The Slack API Incoming WebHooks URL.\n    endpoint:             ~ # Required\n    channel:              null\n    username:             null\n    icon:                 null\n    link_names:           false\n    unfurl_links:         false\n    unfurl_media:         true\n    allow_markdown:       true\n    markdown_in_attachments: []\n```\n\nExcepted `endpoint`, all the other configuration keys are related to the Slack client default settings.\n\nAll those settings are described on the [nexylan/slack documentation](https://github.com/nexylan/slack#settings).\n\n## Usage\n\nThe Slack client instance can be retrieved from the `nexy_slack.client` service.\n\nHere is an example:\n\n```php\n\u003c?php\n\nnamespace AppBundle\\Controller;\n\nuse Nexy\\Slack\\Attachment;\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;\n\nclass DefaultController extends Controller\n{\n    public function indexAction()\n    {\n        $slack = $this-\u003eget('nexy_slack.client');\n\n        $message = $slack-\u003ecreateMessage();\n\n        $message\n            -\u003eto('#test')\n            -\u003efrom('John Doe')\n            -\u003ewithIcon(':ghost:')\n            -\u003esetText('This is an amazing message!')\n        ;\n\n        $message-\u003eattach((new Attachment())\n             -\u003esetFallback('Some fallback text')\n             -\u003esetText('The attachment text')\n         );\n\n        $slack-\u003esendMessage($message);\n    }\n}\n```\n\nAll the how to manipulate the Slack client is on the [nexylan/slack documentation](https://github.com/nexylan/slack#sending-messages).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexylan%2Fslack-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexylan%2Fslack-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexylan%2Fslack-bundle/lists"}