{"id":18696144,"url":"https://github.com/defstudio/laravel-telegram-log","last_synced_at":"2026-04-09T10:32:37.261Z","repository":{"id":49042061,"uuid":"340107714","full_name":"defstudio/laravel-telegram-log","owner":"defstudio","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-12T11:36:34.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-20T10:22:25.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/defstudio.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}},"created_at":"2021-02-18T16:21:41.000Z","updated_at":"2024-07-12T11:36:31.000Z","dependencies_parsed_at":"2023-01-22T14:00:39.195Z","dependency_job_id":null,"html_url":"https://github.com/defstudio/laravel-telegram-log","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Flaravel-telegram-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Flaravel-telegram-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Flaravel-telegram-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Flaravel-telegram-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defstudio","download_url":"https://codeload.github.com/defstudio/laravel-telegram-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243428411,"owners_count":20289315,"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":[],"created_at":"2024-11-07T11:17:21.227Z","updated_at":"2025-12-28T11:06:03.923Z","avatar_url":"https://github.com/defstudio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Telegram Handler \n\nThis is a monolog telegram handler for laravel applications\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require defstudio/laravel-telegram-log\n```\n\nYou can publish the config file with:\n```bash\nphp artisan vendor:publish --provider=\"Defstudio\\LaravelTelegramLog\\LaravelTelegramLogServiceProvider\" --tag=\"config\"\n```\n\nThis is the contents of the published config file:\n\n```php\nreturn [\n    'bot_token' =\u003e env('TELEGRAM_BOT_TOKEN'),\n    'chat_id' =\u003e env('TELEGRAM_CHAT_ID'),\n];\n```\n\n## Usage\n\nAdd the new Log Channel in **config/logging.php**:\n\n```php\n'telegram' =\u003e [\n    'driver' =\u003e 'custom',\n    'via'    =\u003e LaravelTelegramLog::class,\n    'level'  =\u003e 'error',\n],\n```\n\nIf you use the **stack channel** as default logger, you can just the telegram channel to your stack:\n\n```php\n'stack' =\u003e [\n    'driver' =\u003e 'stack',\n    'channels' =\u003e ['single', 'telegram'],\n]\n```\n\nOr you can simply change the default logging channel in the .env file.\n\n```bash\nLOG_CHANNEL=telegram\n```\n\nGreat! Your Laravel project can now send logs to your Telegram chat.\n\nYou can use **Laravel Log Facade** to send logs to your chat:\n\n```php\n// Use the Laravel Log Facade\nuse Illuminate\\Support\\Facades\\Log;\n...\n\n// All Laravel log leves are avaiable\nLog::channel('telegram')-\u003eemergency($message);\nLog::channel('telegram')-\u003ealert($message);\nLog::channel('telegram')-\u003ecritical($message);\nLog::channel('telegram')-\u003eerror($message);\nLog::channel('telegram')-\u003ewarning($message);\nLog::channel('telegram')-\u003enotice($message);\nLog::channel('telegram')-\u003einfo($message);\nLog::channel('telegram')-\u003edebug($message);\n```\n\n# Telegram Instructions\n\nInstructions for creating a new Telegram Bot and getting chat_id from a particular group or chat.\n\n## Creating a Bot\n\n1. Go to [@BotFather](https://t.me/botfather) on Telegram.\n\n2. Send `/newbot`, to start creating a new Bot.\n\n   ![message](https://i.imgur.com/M2KEEp2.png)\n\n3. Set the bot's username and username.\n\n   ![defines-a-bot-name](https://i.imgur.com/ixpfVfQ.png)\n\n4. Now you need to allow your Bot to send direct messages, so send `/setjoingroups` to @BotFather, select your Bot and click Enable:\n\n   ![set-join-group](https://i.imgur.com/TCk4WkC.png)\n\n5. Get the Bot token and add it to your .env file.\n\n   ![get-bot-token](https://i.imgur.com/EwrhvmU.png)\n\n   Bot Token in .env:\n\n   ![token-in-env-file](https://i.imgur.com/SniTiQt.png)\n\n## Getting a Telegram Chat ID\n\n- If you want to send messages to a group:\n\n  1. Add your Bot to a Telegram group.\n  2. Send any message from another user to this group.\n\n- If you want send direct messages to a user:\n\n  1. Search for your bot name, and select the chat.\n  2. Send `/start` to your Bot.\n\n3. Visit the following link to get updates about your bot and get chat_id:\n\n   https://api.telegram.org/botXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/getUpdates\n\nReplace all **X** in the URL with your **Bot Token**.\n\n4. Search for the chat that you want to send messages, and get the **chat-\u003eid**:\n\n   ![get-a-chat-id](https://i.imgur.com/EJIVfWc.png)\n\n5. Add it to your .env file:\n\n   ![env](https://i.imgur.com/aqRdV1S.png)\n\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Fabio Ivona](https://github.com/FabioIvona)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstudio%2Flaravel-telegram-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefstudio%2Flaravel-telegram-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstudio%2Flaravel-telegram-log/lists"}