{"id":15714480,"url":"https://github.com/hampel/slack-message","last_synced_at":"2026-05-08T03:41:12.434Z","repository":{"id":174088539,"uuid":"651425838","full_name":"hampel/slack-message","owner":"hampel","description":"Standalone implementation of Laravel's SlackMessage classes from illuminate/notifications","archived":false,"fork":false,"pushed_at":"2023-06-10T02:06:46.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T20:02:26.703Z","etag":null,"topics":["laravel","notifications","slack"],"latest_commit_sha":null,"homepage":"","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/hampel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-09T08:00:10.000Z","updated_at":"2023-06-09T08:01:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"74bac0eb-911d-458d-adc4-bc77eb74050e","html_url":"https://github.com/hampel/slack-message","commit_stats":null,"previous_names":["hampel/slack-message"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hampel%2Fslack-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hampel%2Fslack-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hampel%2Fslack-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hampel%2Fslack-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hampel","download_url":"https://codeload.github.com/hampel/slack-message/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246372503,"owners_count":20766626,"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":["laravel","notifications","slack"],"created_at":"2024-10-03T21:37:29.282Z","updated_at":"2025-10-27T14:18:56.234Z","avatar_url":"https://github.com/hampel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Slack Message Builder\n=====================\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/hampel/slack-message.svg?style=flat-square)](https://packagist.org/packages/hampel/slack-message)\n[![Total Downloads](https://img.shields.io/packagist/dt/hampel/slack-message.svg?style=flat-square)](https://packagist.org/packages/hampel/slack-message)\n[![Open Issues](https://img.shields.io/github/issues-raw/hampel/slack-message.svg?style=flat-square)](https://github.com/hampel/slack-message/issues)\n[![License](https://img.shields.io/packagist/l/hampel/slack-message.svg?style=flat-square)](https://packagist.org/packages/hampel/slack-message)\n\nStandalone implementation of Laravel's SlackMessage classes from \n[illuminate/notifications](https://github.com/illuminate/notifications).\n\nThis package provides a mechanism for generating correctly formatted Slack messages and sending them via Guzzle. Ideal \nfor use with simple Slack [inbound webhooks](https://api.slack.com/incoming-webhooks), but can also be used with API \ncalls.\n\nBy [Simon Hampel](mailto:simon@hampelgroup.com) based on code by [Taylor Otwell](mailto:taylor@laravel.com) and licensed \nunder the [MIT license](https://opensource.org/licenses/MIT).\n\nPrerequisites\n-------------\n\nYou will need to supply a Guzzle client (^6.0|^7.0) to send the Slack messages.\n\nInstallation\n------------\n\nTo install using composer, run the following command:\n\n`composer require hampel/slack-message`\n\nUsage\n-----\n\nRefer to Laravel's [Slack Notifications](https://laravel.com/docs/6.x/notifications#slack-notifications) documentation \nfor information on generating Slack messages. The syntax is largely the same as that used by Laravel, but we do not \nneed to use Notifiable classes - we can generate and send our Slack Messages directly.\n\n```php\nuse Carbon\\Carbon;\nuse GuzzleHttp\\Client;\nuse Hampel\\SlackMessage\\SlackMessage;\nuse Hampel\\SlackMessage\\SlackWebhook;\n\n$url = 'https://hooks.slack.com/services/\u003cSlack incoming webhook url\u003e';\n$slack = new SlackWebhook(new Client());\n\n$message = $slack-\u003emessage(function ($message) {\n    $message\n        -\u003econtent('Content')\n        -\u003eattachment(function ($attachment) {\n            $attachment\n                -\u003etitle('Laravel', 'https://laravel.com')\n                -\u003econtent('Attachment Content')\n                -\u003efallback('Attachment Fallback')\n                -\u003efields([\n                    'Project' =\u003e 'Laravel',\n                ])\n                -\u003efooter('Laravel')\n                -\u003efooterIcon('https://laravel.com/fake.png')\n                -\u003emarkdown(['text'])\n                -\u003eauthor('Author', 'https://laravel.com/fake_author', 'https://laravel.com/fake_author.png')\n                -\u003etimestamp(Carbon::now());\n        });\n});\n\n$slack-\u003esend($url, $message);\n```\n\nReferences\n----------\n\n* [Slack API documentation](https://api.slack.com/)\n* Slack API: [An introduction to messages](https://api.slack.com/docs/messages)\n* Laravel: [Slack Notifications](https://laravel.com/docs/6.x/notifications#slack-notifications)\n* Laravel Package: [laravel/slack-notification-channel](https://github.com/laravel/slack-notification-channel) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhampel%2Fslack-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhampel%2Fslack-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhampel%2Fslack-message/lists"}