{"id":28517541,"url":"https://github.com/invokable/laravel-notification-discord-webhook","last_synced_at":"2025-08-18T11:12:15.228Z","repository":{"id":229954271,"uuid":"778087953","full_name":"invokable/laravel-notification-discord-webhook","owner":"invokable","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-21T10:07:25.000Z","size":66,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-22T10:38:10.101Z","etag":null,"topics":["discord"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/revolution/laravel-notification-discord-webhook","language":"PHP","has_issues":false,"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/invokable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null},"funding":{"github":["invokable"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-03-27T03:42:52.000Z","updated_at":"2025-06-21T10:07:28.000Z","dependencies_parsed_at":"2024-03-27T04:47:29.667Z","dependency_job_id":"705ba1e9-ad65-4427-b87e-a5cce1d4f6ea","html_url":"https://github.com/invokable/laravel-notification-discord-webhook","commit_stats":null,"previous_names":["kawax/laravel-notification-discord-webhook","invokable/laravel-notification-discord-webhook"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/invokable/laravel-notification-discord-webhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-notification-discord-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-notification-discord-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-notification-discord-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-notification-discord-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invokable","download_url":"https://codeload.github.com/invokable/laravel-notification-discord-webhook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-notification-discord-webhook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270982207,"owners_count":24679449,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discord"],"created_at":"2025-06-09T05:08:48.730Z","updated_at":"2025-08-18T11:12:15.220Z","avatar_url":"https://github.com/invokable.png","language":"PHP","funding_links":["https://github.com/sponsors/invokable"],"categories":[],"sub_categories":[],"readme":"# Laravel Notification for Discord(Webhook)\n\n[![Maintainability](https://qlty.sh/badges/31f8a4d4-2dc7-4331-9b55-144df15fff85/maintainability.svg)](https://qlty.sh/gh/invokable/projects/laravel-notification-discord-webhook)\n[![Code Coverage](https://qlty.sh/badges/31f8a4d4-2dc7-4331-9b55-144df15fff85/test_coverage.svg)](https://qlty.sh/gh/invokable/projects/laravel-notification-discord-webhook)\n\n## Introduction\n\nThis package allows you to easily send notifications to Discord by simply specifying a webhook. With this Laravel notification channel, you can quickly integrate Discord notifications into your application without dealing with the complexities of Discord's API. Just configure your webhook URL and start sending notifications right away.\n\nhttps://discord.com/developers/docs/resources/webhook#execute-webhook\n\n## Requirements\n- PHP \u003e= 8.2\n- Laravel \u003e= 11.0\n\n## Installation\n\n```shell\ncomposer require revolution/laravel-notification-discord-webhook\n```\n\n### Uninstall\n```shell\ncomposer remove revolution/laravel-notification-discord-webhook\n```\n\n## Config\nGet the webhook url from your Discord server settings.  \nhttps://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks\n\n### config/services.php\n```php\n    'discord' =\u003e [\n        'webhook' =\u003e env('DISCORD_WEBHOOK'),\n    ],\n```\n\n### .env\n```\nDISCORD_WEBHOOK=https://discord.com/api/webhooks/...\n```\n\n## Usage\n\n```php\n\u003c?php\n\nnamespace App\\Notifications;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Notifications\\Notification;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordChannel;\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordMessage;\n\nclass DiscordNotification extends Notification implements ShouldQueue\n{\n    use Queueable;\n\n    public function __construct(protected string $content)\n    {\n        //\n    }\n\n    public function via($notifiable): array\n    {\n        return [DiscordChannel::class];\n    }\n\n    public function toDiscordWebhook(object $notifiable): DiscordMessage\n    {\n        return DiscordMessage::create(content: $this-\u003econtent);\n    }\n}\n```\n\n### On-Demand Notification\n\n```php\nuse Illuminate\\Support\\Facades\\Notification;\n\nNotification::route('discord-webhook', config('services.discord.webhook'))\n            -\u003enotify(new DiscordNotification('test'));\n```\n\n### User Notification\n\n```php\nuse Illuminate\\Notifications\\Notifiable;\n\nclass User extends Authenticatable\n{\n    use Notifiable;\n\n    public function routeNotificationForDiscordWebhook($notification): string\n    {\n        return $this-\u003ediscord_webhook;\n    }\n}\n```\n\n```php\n$user-\u003enotify(new DiscordNotification('test'));\n```\n\n### Send embeds\n\n```php\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordMessage;\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordEmbed;\n\n    public function toDiscordWebhook(object $notifiable): DiscordMessage\n    {\n        return DiscordMessage::create()\n                              -\u003eembed(\n                                  DiscordEmbed::make(\n                                      title: 'INFO',\n                                      description: $this-\u003econtent,\n                                      url: route('home'),\n                                  )\n                              );\n    }\n```\n\n### Send attachment files\n\nSend only file. `content` and `filename` are required.\n```php\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordMessage;\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordAttachment;\nuse Illuminate\\Support\\Facades\\Storage;\n\n    public function toDiscordWebhook(object $notifiable): DiscordMessage\n    {\n        return DiscordMessage::create()\n            -\u003efile(\n                DiscordAttachment::make(\n                    content: Storage::get('test.png'),\n                    filename: 'test.png',\n                    description: 'test',\n                    filetype: 'image/png'\n                ));\n    }\n```\n\nUsing files in embed.\n```php\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordMessage;\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordAttachment;\nuse Revolution\\Laravel\\Notification\\DiscordWebhook\\DiscordEmbed;\nuse Illuminate\\Support\\Facades\\Storage;\n\n    public function toDiscordWebhook(object $notifiable): DiscordMessage\n    {\n        return DiscordMessage::create()\n                              -\u003eembed(\n                                    DiscordEmbed::make(\n                                        title: 'test',\n                                        description: $this-\u003econtent,\n                                        image: 'attachment://test.jpg',\n                                        thumbnail: 'attachment://test2.jpg',\n                                    )\n                              );\n                              -\u003efile(DiscordAttachment::make(\n                                   content: Storage::get('test.jpg'),\n                                   filename: 'test.jpg', \n                                   description: 'test', \n                                   filetype: 'image/jpg'\n                              ))\n                              -\u003efile(new DiscordAttachment(\n                                   content: Storage::get('test2.jpg'),\n                                   filename: 'test2.jpg', \n                                   description: 'test2', \n                                   filetype: 'image/jpg'\n                              ));\n    }\n```\n\n### Send any message\n\n```php\n    public function toDiscordWebhook(object $notifiable): DiscordMessage\n    {\n        return DiscordMessage::create()\n                              -\u003ewith([\n                                  'content' =\u003e $this-\u003econtent,\n                                  'embeds' =\u003e [[]],\n                               ]);\n    }\n```\n\n## LICENSE\nMIT    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvokable%2Flaravel-notification-discord-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvokable%2Flaravel-notification-discord-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvokable%2Flaravel-notification-discord-webhook/lists"}