{"id":36331140,"url":"https://github.com/it-healer/laravel-telegram-bot","last_synced_at":"2026-01-11T12:00:03.840Z","repository":{"id":306088162,"uuid":"1024990649","full_name":"it-healer/laravel-telegram-bot","owner":"it-healer","description":"A library for convenient creation of Telegram bots by analogy with the creation of Web sites on Laravel.","archived":false,"fork":false,"pushed_at":"2025-11-09T07:49:54.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-09T09:20:51.863Z","etag":null,"topics":["bot","laravel","library","php","telegram","telegrambot","tg"],"latest_commit_sha":null,"homepage":"https://t.me/it_healer_bot","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/it-healer.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-23T14:51:26.000Z","updated_at":"2025-11-09T07:49:22.000Z","dependencies_parsed_at":"2025-07-23T16:24:54.585Z","dependency_job_id":"01b805be-576e-4bb2-9461-306edef3a86c","html_url":"https://github.com/it-healer/laravel-telegram-bot","commit_stats":null,"previous_names":["it-healer/laravel-telegram-bot"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/it-healer/laravel-telegram-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/it-healer%2Flaravel-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/it-healer%2Flaravel-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/it-healer%2Flaravel-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/it-healer%2Flaravel-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/it-healer","download_url":"https://codeload.github.com/it-healer/laravel-telegram-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/it-healer%2Flaravel-telegram-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28301953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bot","laravel","library","php","telegram","telegrambot","tg"],"created_at":"2026-01-11T12:00:03.610Z","updated_at":"2026-01-11T12:00:03.818Z","avatar_url":"https://github.com/it-healer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Telegram Bot\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/it-healer/laravel-telegram-bot.svg?style=flat-square)](https://packagist.org/packages/it-healer/laravel-telegram-bot)\n[![Total Downloads](https://img.shields.io/packagist/dt/it-healer/laravel-telegram-bot.svg?style=flat-square)](https://packagist.org/packages/it-healer/laravel-telegram-bot)\n\nThis package for Laravel 11+ allows you to easily create interactive Telegram bots, using Laravel routing, and using Blade templates to conduct a dialogue with the user.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require it-healer/laravel-telegram-bot\n```\n\n```bash\nphp artisan telegram:install\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --tag=\"telegram-migrations\"\nphp artisan migrate\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"telegram-config\"\n```\n\nOptionally, you can publish the views using:\n\n```bash\nphp artisan vendor:publish --tag=\"telegram-views\"\n```\n\nOptionally, if you use Sail for local development, you need add PHP params `PHP_CLI_SERVER_WORKERS=\"10\"` in file `supervisord.conf`:\n```bash\n[program:php]\ncommand=%(ENV_SUPERVISOR_PHP_COMMAND)s\nuser=%(ENV_SUPERVISOR_PHP_USER)s\nenvironment=LARAVEL_SAIL=\"1\",PHP_CLI_SERVER_WORKERS=\"10\"\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n```\n\nYou can use Laravel Auth, edit file `config/auth.php` and edit section `guards`:\n```php\n'guards' =\u003e [\n        'web' =\u003e [...],\n        'telegram' =\u003e [\n            'driver' =\u003e 'telegram',\n            'provider' =\u003e 'users',\n        ]\n    ],\n```\n\nAfter this you can use middleware `auth:telegram` in your routes.\n\nIf you want work with automatic truncate dialogs, you must run command `php artisan telegram:truncate` every minute using Schedule.\n\n```php\n-\u003ewithMiddleware(function (Middleware $middleware) {\n    $middleware-\u003ealias([\n        'telegram.live' =\u003e \\ItHealer\\Telegram\\Middleware\\LiveMiddleware::class,\n    ]);\n})\n```\n\nAfter you can use middleware in routes:\n```php\nRoute::telegram('/', [\\App\\Telegram\\Controllers\\MyController::class, 'index'])\n    -\u003emiddleware(['telegram.live:30']);\n```\n\nArguments - is frequency in seconds, how often to update the page.\n\nIn file `routes/console.php` add:\n```php\nSchedule::command('telegram:live')\n    -\u003erunInBackground()\n    -\u003eeveryMinute();\n```\n\n## Usage\n\nCreate new Telegram Bot:\n\n```php\nphp artisan telegram:new-bot\n```\n\n\nSet Webhook for bot:\n\n```php\nphp artisan telegram:set-webhook\n```\n\n\nUnset Webhook for bot:\n\n```php\nphp artisan telegram:unset-webhook\n```\n\n\nManual pooling (on localhost) for bot:\n\n```php\nphp artisan telegram:pooling [BOT_ID]\n```\n\n\n### Inline Keyboard\n\nIf you want create button for change current URI query params, use this template:\n\n```html\n\u003cinline-keyboard\u003e\n    \u003crow\u003e\n        \u003ccolumn query-param=\"value\"\u003eChange query param\u003c/column\u003e\n    \u003c/row\u003e\n\u003c/inline-keyboard\u003e\n```\n\nIf you want send POST data you must use this template:\n\n```html\n\u003cinline-keyboard\u003e\n    \u003crow\u003e\n        \u003ccolumn data-field=\"value\"\u003eSend field value\u003c/column\u003e\n    \u003c/row\u003e\n\u003c/inline-keyboard\u003e\n```\n\nIf you POST data is long, you can encrypt using this template:\n\n```html\n\u003cinline-keyboard\u003e\n    \u003crow\u003e\n        \u003ccolumn data-field=\"long value\" encode=\"true\"\u003eEncoded send data\u003c/column\u003e\n    \u003c/row\u003e\n\u003c/inline-keyboard\u003e\n```\n\nIf you want make redirect to another page from button, use this template:\n\n```html\n\u003cinline-keyboard\u003e\n    \u003crow\u003e\n        \u003ccolumn data-redirect=\"/\"\u003eRedirect to /\u003c/column\u003e\n    \u003c/row\u003e\n\u003c/inline-keyboard\u003e\n```\n\n### Edit Form\n\n```php\nclass MyForm extends \\ItHealer\\Telegram\\EditForm\\BaseForm \n{\n    public function rules(): array\n    {\n        return [\n            'name' =\u003e ['required', 'string', 'min:5', 'max:255'],\n            'phone' =\u003e ['required', 'string', 'min:10', 'max:15'],\n        ];\n    }\n    \n    public function titles(): array\n    {\n        return [\n            'name' =\u003e 'Ваше имя',\n            'phone' =\u003e 'Ваш номер телефона'\n        ];\n    }\n}\n```\n\n```php\nclass MyController \n{\n    public function edit(MyForm $form): mixed\n    {\n        $form-\u003esetDefault([\n            'name' =\u003e 'Default name',\n            'phone' =\u003e '1234567890',\n        ]);\n        \n        if( $form-\u003evalidate() ) {\n            // $form-\u003eget();\n        }\n        \n        return view('...', compact('form'));\n    }\n    \n    public function create(MyForm $form): mixed\n    {\n        if( $form-\u003eisCreate()-\u003evalidate() ) {\n            // $form-\u003eget();\n        }\n        \n        return view('...', compact('form'));\n    }\n}\n```\n\n```html\n\u003cmessage\u003e\n    \u003cx-telegram-edit-form :form=\"$form\"\u003e\n        \u003cx-slot:name\u003e\n            \u003cline\u003ePlease, enter your First Name:\u003c/line\u003e\n        \u003c/x-slot:name\u003e\n    \u003c/x-telegram-edit-form\u003e\n\u003c/message\u003e\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n- [IT-HEALER](https://github.com/it-healer)\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%2Fit-healer%2Flaravel-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fit-healer%2Flaravel-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fit-healer%2Flaravel-telegram-bot/lists"}