PHPackages                             thecipherdetective/phpeasykeyboard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thecipherdetective/phpeasykeyboard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thecipherdetective/phpeasykeyboard
==================================

A simple library to create Telegram keyboards easy and fast.

00PHP

Since Jun 24Pushed 1mo agoCompare

[ Source](https://github.com/TheCipherDetective/phpEasyKeyboard)[ Packagist](https://packagist.org/packages/thecipherdetective/phpeasykeyboard)[ RSS](/packages/thecipherdetective-phpeasykeyboard/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

phpEasyKeyboard
===============

[](#phpeasykeyboard)

**The easiest and fastest way to build Telegram keyboards in PHP** 🚀

[![PHP](https://camo.githubusercontent.com/30da60ee026a505924b598ee10e72b4f78c52de0509ddad6d8574eb1b5713b08/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e342d626c7565)](https://camo.githubusercontent.com/30da60ee026a505924b598ee10e72b4f78c52de0509ddad6d8574eb1b5713b08/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e342d626c7565)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)[![Composer](https://camo.githubusercontent.com/e76dd294010fe965fc6ce5e7de93d4fa854f0d9aeac7e0181c71d21b843bf293/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d72656164792d677265656e)](https://camo.githubusercontent.com/e76dd294010fe965fc6ce5e7de93d4fa854f0d9aeac7e0181c71d21b843bf293/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d72656164792d677265656e)

A lightweight and fluent PHP library for creating **Inline Keyboards** and **Reply Keyboards** for Telegram Bots.

---

About This Project
------------------

[](#about-this-project)

This library was my **first real experience with Object-Oriented Programming (OOP)** many years ago and found it when I was exploring my old codes. I originally designed and developed it as a learning project to better understand OOP concepts in PHP.

Even though I haven't actively maintained it for a while, I believe it can still be genuinely helpful for the community. Many existing Telegram wrappers make keyboard creation unnecessarily complicated, while **phpEasyKeyboard** focuses on maximum simplicity and a clean fluent interface.

---

✨ Features
----------

[](#-features)

- Beautiful **Fluent Interface** (Method Chaining)
- Support for all Telegram button types (Callback, URL, Web App, Request User, Copy, Login, etc.)
- Automatic row &amp; column management
- Easy JSON conversion
- PSR-4 compliant
- Lightweight with zero dependencies

---

📦 Installation
--------------

[](#-installation)

```
composer require thecipherdetective/phpeasykeyboard
```

---

📌 Important Notes
-----------------

[](#-important-notes)

- Telegram limit: Maximum **100 buttons** per keyboard
- Check out [![Examples](https://github.com/TheCipherDetective/phpEasyKeyboard/tree/main/examples)](https://github.com/TheCipherDetective/phpEasyKeyboard/tree/main/examples)

---

🚀 Quick Start
-------------

[](#-quick-start)

### Inline Keyboard

[](#inline-keyboard)

```
use TheCipherDetective\PhpEasyKeyboard\Keyboards\InlineKeyboard;

$keyboard = new InlineKeyboard();

$keyboard
    ->createCallbackButton("👍 Like", "like_123")
    ->createUrlButton("🌐 Visit Website", "https://example.com")
    ->addRow() // Start new row
    ->createWebAppButton("🧩 Open Web App", ["url" => "https://example.com/webapp"])
    ->createCopyButton("📋 Copy Text", "Text to be copied");

echo $keyboard->getInlineKeyboardAsJson();
```

### Reply Keyboard

[](#reply-keyboard)

```
use TheCipherDetective\PhpEasyKeyboard\Keyboards\ReplyKeyboard;

$keyboard = new ReplyKeyboard(maxColumns: 3);

$keyboard
    ->createTextButton("📍 Send Location")
    ->createRequestContactButton("📞 Share Contact")
    ->createRequestLocationButton("📍 Share My Location")
    ->setResizeKeyboard(true)
    ->setOneTimeKeyboard(true);

echo $keyboard->getKeyboardAsJson();
```

---

📖 Documentation
---------------

[](#-documentation)

### InlineKeyboard Methods

[](#inlinekeyboard-methods)

MethodDescription`createCallbackButton($text, $callback_data)`Callback button`createUrlButton($text, $url)`URL button`createWebAppButton($text, $web_app)`Web App button`createCopyButton($text, $copy_text)`Copy text button`createLoginUrlButton(...)`Login URL button`createSwitchInlineQueryButton(...)`Switch inline query`getInlineKeyboard()`Returns array`getInlineKeyboardAsJson()`Returns JSON string### ReplyKeyboard Methods

[](#replykeyboard-methods)

MethodDescription`createTextButton($text)`Regular text button`createRequestContactButton($text)`Request contact`createRequestLocationButton($text)`Request location`createRequestUsersButton(...)`Request users`createRequestChatButton(...)`Request chat`setResizeKeyboard(bool)`Resize keyboard`setOneTimeKeyboard(bool)`One-time keyboard`setIsPersistent(bool)`Persistent keyboard`setPlaceholder(string)`Input placeholder---

⚙️ Configuration
----------------

[](#️-configuration)

```
// Custom grid size
new InlineKeyboard(maxColumns: 3, maxRows: 10);
new ReplyKeyboard(maxColumns: 4, maxRows: 8, is_persistent: true);
```

---

🤝 Contributing
--------------

[](#-contributing)

Contributions, issues, and feature requests are very welcome!
Since this was originally a learning project, any help to improve code quality, add tests, fix typos, or enhance documentation is greatly appreciated.

---

📄 License
---------

[](#-license)

This project is licensed under the **MIT License**.

---

**Made with ❤️ for the Telegram Bot developer community**

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance60

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/af12efc84dbcdae3e46b0b0e77e2a5e030944f3943e7d6656c06ba66cb48eca6?d=identicon)[thecipherdetective](/maintainers/thecipherdetective)

---

Top Contributors

[![TheCipherDetective](https://avatars.githubusercontent.com/u/293152235?v=4)](https://github.com/TheCipherDetective "TheCipherDetective (1 commits)")

### Embed Badge

![Health badge](/badges/thecipherdetective-phpeasykeyboard/health.svg)

```
[![Health](https://phpackages.com/badges/thecipherdetective-phpeasykeyboard/health.svg)](https://phpackages.com/packages/thecipherdetective-phpeasykeyboard)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
