Download the PHP package iperamuna/laravel-telegram-log-buttons without Composer

On this page you can find all versions of the php package iperamuna/laravel-telegram-log-buttons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-telegram-log-buttons

Laravel Telegram Log Buttons

A Laravel package to send Telegram log messages with inline buttons via Monolog, with:

Note: The template/view mechanism for formatting log messages is inspired by grkamil/laravel-telegram-logging. Credit goes to the original author for this excellent feature.


Installation

Quick Setup (Recommended)

Run the interactive setup wizard:

This command will:

  1. ✅ Ask for your Telegram bot token (or use existing)
  2. ✅ Verify the bot token with Telegram
  3. ✅ Guide you through connecting to a Telegram group/chat
  4. ✅ Auto-detect chat ID from recent updates
  5. ✅ Set up the callback webhook automatically
  6. ✅ Configure health check endpoint (optional)
  7. ✅ Select logging mode (instant/buffered)
  8. ✅ Update your .env file with all necessary values

Manual Setup

Publish config:

This publishes:


Configuration

Configure your Telegram bot token and chat ID in .env:

These are automatically loaded from config/telegram-log.php:

Add the Telegram log channel to config/logging.php:


Usage

Telegram Log Buttons

This package extends Laravel's logging system to send messages with inline buttons to Telegram. You can add buttons using three convenient methods:

Method 1: Using buttons() Macro (Fluent Builder)

The buttons() macro returns a TelegramButtonBuilder instance for fluent button creation:

Available methods:

Example with multiple rows:

Method 2: Using addButton() Macro (Quick Single Button)

Add a single URL button quickly:

Method 3: Using addButtons() Macro (Multiple Buttons)

Add multiple buttons at once (each button goes on its own row):

Using with Logger Instances

You can also use these macros with logger instances directly:

Button Types

URL Buttons:

Callback Buttons:

Callback buttons trigger webhook callbacks that can be handled by callback handlers (see Callbacks section below).


Message Templates

This package supports customizable Blade templates for formatting log messages, inspired by grkamil/laravel-telegram-logging.

Default Templates

Two templates are included:

Configure Template

Set the default template in .env:

Or in config/telegram-log.php:

Override Template Per Channel

You can override the template for a specific logging channel using handler_with:

Create Custom Templates

  1. Publish views (optional, to customize):

This publishes templates to resources/views/vendor/telegram-log/.

  1. Create your custom template in resources/views/vendor/telegram-log/custom.blade.php:

  2. Use your custom template:

Available Template Variables

Templates receive the following variables:


Callbacks

Callback Generator

Generate callback handler classes using Laravel Prompts:

The command will:

  1. Generate app/Telegram/Callbacks/BanUserCallback.php:

  2. Update config/telegram-log-callbacks.php:

  3. Print usage hints:

Because it uses Laravel Prompts:

List Registered Callbacks

View all registered callback handlers:

Outputs a table:

Callback Registry & Facade

You can programmatically register callback handlers using the TelegramCallbacks facade:

Note: Handlers registered via the facade will override config-based handlers for the same action.


Commands

Interactive Setup

Interactive wizard that guides you through:

Callback Management

Webhook Management

Chat ID Discovery

Buffered Log Flushing


Health Check Route

Enable the health check endpoint in config/telegram-log.php:

When enabled is true, the package registers:

It returns JSON like:

If TELEGRAM_LOG_HEALTH_SECRET is set, the route expects:

So you can put this behind a probe or internal monitoring.


Tests

Dev dependencies:

Run tests:


License

MIT – see LICENSE.


All versions of laravel-telegram-log-buttons with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/support Version ^11.0|^12.0
illuminate/redis Version ^11.0|^12.0
guzzlehttp/guzzle Version ^7.8
monolog/monolog Version ^3.0
laravel/prompts Version ^0.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iperamuna/laravel-telegram-log-buttons contains the following files

Loading the files please wait ...