{"id":26965569,"url":"https://github.com/micromagicman/laravel-telegram-webapp","last_synced_at":"2025-04-03T07:29:50.373Z","repository":{"id":208472674,"uuid":"718746512","full_name":"micromagicman/laravel-telegram-webapp","owner":"micromagicman","description":"Laravel package for Telegram WebApp integration","archived":false,"fork":false,"pushed_at":"2024-05-26T16:01:43.000Z","size":88,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-28T11:46:55.142Z","etag":null,"topics":["laravel","laravel-telegram-miniapp","laravel-telegram-webapp","telegram","telegram-bot","telegram-mini-app","telegram-web-app"],"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/micromagicman.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}},"created_at":"2023-11-14T18:05:20.000Z","updated_at":"2024-07-25T15:32:33.000Z","dependencies_parsed_at":"2024-12-17T09:26:17.126Z","dependency_job_id":"d0c4e44f-fd3f-424e-a95e-323fc1c0d6c8","html_url":"https://github.com/micromagicman/laravel-telegram-webapp","commit_stats":null,"previous_names":["micromagicman/laravel-telegram-webapp"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromagicman%2Flaravel-telegram-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromagicman%2Flaravel-telegram-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromagicman%2Flaravel-telegram-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromagicman%2Flaravel-telegram-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micromagicman","download_url":"https://codeload.github.com/micromagicman/laravel-telegram-webapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246955741,"owners_count":20860340,"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","laravel-telegram-miniapp","laravel-telegram-webapp","telegram","telegram-bot","telegram-mini-app","telegram-web-app"],"created_at":"2025-04-03T07:29:49.893Z","updated_at":"2025-04-03T07:29:50.351Z","avatar_url":"https://github.com/micromagicman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Telegram WebApp package\n\n![build](https://github.com/micromagicman/laravel-telegram-webapp/actions/workflows/laravel-telegram-webapp-ci.yml/badge.svg)\n[![codecov](https://codecov.io/github/micromagicman/laravel-telegram-webapp/graph/badge.svg?token=ZSVF7MGB38)](https://codecov.io/github/micromagicman/laravel-telegram-webapp)\n\nLaravel package that allows you to process commands from Telegram MiniApp with user verification according to\n[Telegram MiniApp developer documentation](https://core.telegram.org/bots/webapps), as well as obtaining information\nabout the Telegram user who sent the request\n\n## Requirements\n\n| Laravel | micromagicman/laravel-telegram-webapp |\n|---------|---------------------------------------|\n| 10.x    | 1.x.x                                 |\n| 11.x    | 2.x.x                                 |\n\n## Install\n\n### Via composer\n\n```bash\ncomposer require micromagicman/laravel-telegram-webapp\n```\n\n### Publishing\n\nPublish to your Laravel application:\n\n```bash\nphp artisan vendor:publish --provider=\"Micromagicman\\TelegramWebApp\\TelegramWebAppServiceProvider\"\n```\n\n## Configure\n\nAll package configuration available in `config/telegram-webapp.php` file after `publish` command execution:\n\n| Config name               | Description                                                                                                                                                                                                                                                                                                                                                         | Environment                               | Default value                                 |\n|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|-----------------------------------------------|\n| `enabled`                 | Telegram MiniApp data validation switch                                                                                                                                                                                                                                                                                                                             | `TELEGRAM_WEBAPP_DATA_VALIDATION_ENABLED` | `true`                                        |\n| `webAppScriptLocation`    | Path to script (.js) which initializes Telegram MiniApp on your frontend app                                                                                                                                                                                                                                                                                        | -                                         | `https://telegram.org/js/telegram-web-app.js` |\n| `botToken`                | Your Telegram bot token                                                                                                                                                                                                                                                                                                                                             | `TELEGRAM_BOT_TOKEN`                      | -                                             |\n| `error.status`            | HTTP status code when Telegram MiniApp data validation fails                                                                                                                                                                                                                                                                                                        | -                                         | 403 (Forbidden)                               |\n| `error.message`           | Error message returned when Telegram MiniApp data validation fails                                                                                                                                                                                                                                                                                                  | -                                         | 403 (Forbidden)                               |\n| `authDateLifetimeSeconds` | The lifetime of the Telegram initData auth_date parameter in seconds. The request to the server must be made within this interval, otherwise the data transmitted from Telegram will be considered invalid. The values of the parameter \u003c= 0 imply that there is no verification of the lifetime of data from telegram and the auth_date parameter is not validated | -                                         | 0                                             |\n\nExample in code:\n\n## View\n\nThis package provides a root view for Telegram MiniApp frontend applications.\n[Telegram WebApp script](https://telegram.org/js/telegram-web-app.js) is automatically includes to this view or its\ninheritors if `telegram-webapp.enabled` switch is `true`\n\nExample:\n\n```php\n@extends('telegram-webapp::main')\n\n@section('lang', 'CN')\n\n@section('head')\n// some scripts, css, meta\n@endsection\n\n@section('title', 'My title')\n\n@section('content')\n    \u003cdiv id=\"app-content\"\u003e\n        // My spa content\n    \u003c/div\u003e\n@endsection\n```\n\n## Telegram bot API\n\n### answerWebAppQuery\n\nSet the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat \nfrom which the query originated. On success, an `Illuminate\\Http\\Client\\Response` object is returned.\n\n#### Parameters\n\n`$result` - one of [InlineQueryResult](https://core.telegram.org/bots/api#inlinequeryresult) variations (php array)\n\n```php\n\nuse Micromagicman\\TelegramWebApp\\Api\\TelegramBotApi;\n\nprivate TelegramBotApi $botApi;\n\n$response = $botApi-\u003eanswerWebpAppQuery([\n    'type' =\u003e 'document'\n    // ...\n    // one of InlineQueryResult variations\n    // ...\n]);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromagicman%2Flaravel-telegram-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicromagicman%2Flaravel-telegram-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromagicman%2Flaravel-telegram-webapp/lists"}