Download the PHP package tankertrackers/laravel-telegram-bot-logger without Composer

On this page you can find all versions of the php package tankertrackers/laravel-telegram-bot-logger. 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-bot-logger

laravel-telegram-bot-logger

Note This was built under Laravel 10.x using PHP 8.1, so it has been locked to require at least those versions as I cannot guarantee functionality in previous versions of Laravel and/or PHP.

An easy-to-use wrapper around Telegram, allowing you to use it as a Monolog output channel in your Laravel applications. It does not require any dependencies not already in Laravel and there are no extra config files to worry about, allowing you to be up and running with this fairly quickly.

Note that this package is fairly opinionated in how it formats the output of the messages, but future versions will most likely introduce several ways to customize the output. In the current version, it outputs two or three rows, depending on if context is provided as the second input to your Log facade:

Running the command Log::warning('User failed password check.', ['user' => $user->id]) would result in the following message being sent to Telegram:

Installation

1 - Adding the Package

2 - Creating the Telegram Bot

This package requires you to create a Telegram bot, which will act as the sender of the log messages:

3 - Updating your Logging Configuration

First, add the keys TELEGRAM_BOT_TOKEN and TELEGRAM_CHANNEL to your .env file:

Note that TELEGRAM_CHANNEL can be either the ID of a user or a Telegram chat channel that you have invited the bot to. To get your own ID, open a chat with jsondumpbot and send it a /start command, and it will return to you your user's id value (under the key message.chat.id).

Getting the id for a Telegram chat channel seems to change every so often, so I recommend you Google for various solutions to this, as any suggestion given here might no longer be valid in a few weeks' time.

Then, include the following in your config/logging.php. Note that this will output messages of level debug and higher to Telegram when you are running your application in a non-production environment, but only info and higher when running in production. You are free to change these settings as you see fit, of course.

If the level key is not provided, it will default to info and higher.

Once that is done, you can add telegram as a channel in your output stack at the top of config/logging.php:

Development

Development of this library is ongoing. Future versions will contain things like:

Credits

No package exists in a vacuum, and with there already being plenty of Monolog wrappers around Telegram, I had plenty of inspiration from other places when making this package. Each of these packages did some things that I liked and other things that I didn't like, but reading them allowed me to better understand how best to write my own package. One of these may be well suited for your requirements if you feel that this package is too opinionated.

The packages I examined include, but are not limited to:

Copyright

This software is covered by the MIT License. See the file LICENSE for more information.


All versions of laravel-telegram-bot-logger with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
monolog/monolog Version ^3.0
guzzlehttp/guzzle Version ^7.4
illuminate/support Version ^10.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 tankertrackers/laravel-telegram-bot-logger contains the following files

Loading the files please wait ....