{"id":20247961,"url":"https://github.com/dmiseev/laravel-telegram-notification","last_synced_at":"2026-03-06T05:40:07.160Z","repository":{"id":56970163,"uuid":"117154866","full_name":"dmiseev/laravel-telegram-notification","owner":"dmiseev","description":"Telegram Notifications for Laravel 5.5","archived":false,"fork":false,"pushed_at":"2018-03-09T10:33:09.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T19:22:01.507Z","etag":null,"topics":["bot-api","laravel","notifications","telegram-notification"],"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/dmiseev.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}},"created_at":"2018-01-11T21:19:50.000Z","updated_at":"2021-08-09T16:14:38.000Z","dependencies_parsed_at":"2022-08-21T06:40:18.319Z","dependency_job_id":null,"html_url":"https://github.com/dmiseev/laravel-telegram-notification","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmiseev%2Flaravel-telegram-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmiseev%2Flaravel-telegram-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmiseev%2Flaravel-telegram-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmiseev%2Flaravel-telegram-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmiseev","download_url":"https://codeload.github.com/dmiseev/laravel-telegram-notification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248307277,"owners_count":21081818,"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":["bot-api","laravel","notifications","telegram-notification"],"created_at":"2024-11-14T09:44:13.703Z","updated_at":"2026-03-06T05:40:06.913Z","avatar_url":"https://github.com/dmiseev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Notifications for Laravel 5.6\n\nThis package makes it easy to send Telegram notification using [Telegram Bot API](https://core.telegram.org/bots) with Laravel 5.5.\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require dmiseev/laravel-telegram-notification\n```\n\n## Setting up your Telegram Bot\n\nTalk to [@BotFather](https://core.telegram.org/bots#6-botfather) and generate a Bot API Token.\n\nThen, configure your Telegram Bot API Token:\n\n```php\n// config/services.php\n...\n'telegram' =\u003e [\n    'token' =\u003e env('TELEGRAM_TOKEN', 'YOUR BOT TOKEN HERE')\n],\n...\n```\n\n## Usage\n\nYou can now use the channel in your `via()` method inside the Notification class.\n\n``` php\nuse Dmiseev\\TelegramNotification\\TelegramChannel;\nuse Dmiseev\\TelegramNotification\\TelegramMessage;\nuse Illuminate\\Notifications\\Notification;\n\nclass WithdrawCreate extends Notification\n{\n    /**\n     * @var Withdraw\n     */\n    private $withdraw;\n    \n    /**\n     * @var User\n     */\n    private $user;\n\n    /**\n     * @param Withdraw $withdraw\n     */\n    public function __construct(Withdraw $withdraw, User $user)\n    {\n        $this-\u003ewithdraw = $withdraw;\n        $this-\u003euser = $user;\n    }\n    \n    public function via($notifiable)\n    {\n        return [TelegramChannel::class];\n    }\n\n    public function toTelegram($notifiable)\n    {\n        return TelegramMessage::create()\n            -\u003eto($this-\u003euser-\u003etelegram_user_id)\n            -\u003econtent(\"*HI!* \\n One of your withdraws has been created!\")\n            -\u003ebutton('View Withdraw', url('/withdraws/' . $this-\u003ewithdraw-\u003eid));\n    }\n}\n```\n\n### Routing a message\n\nYou can either send the notification by providing with the chat id of the recipient to the `to($chatId)` method like shown in the above example or add a `routeNotificationForTelegram()` method in your notifiable model:\n\n``` php\n...\n/**\n * @return int\n */\npublic function routeNotificationForTelegram()\n{\n    return $this-\u003etelegram_user_id;\n}\n...\n```\n\n### Available Message methods\n\n- `to($chatId)`: (integer) Recipient's chat id.\n- `content('')`: (string) Notification message, supports markdown. For more information on supported markdown styles, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage#section-markdown-style).\n- `button($text, $url)`: (string) Adds an inline \"Call to Action\" button. You can add as many as you want and they'll be placed 2 in a row.\n- `options([])`: (array) Allows you to add additional or override `sendMessage` payload (A Telegram Bot API method used to send message internally). For more information on supported parameters, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage).\n\n## Security\n\nIf you discover any security related issues, please email dmiseev@gmail.com instead of using the issue tracker.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmiseev%2Flaravel-telegram-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmiseev%2Flaravel-telegram-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmiseev%2Flaravel-telegram-notification/lists"}