Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muath-ye/laravel-telegram-log
https://github.com/muath-ye/laravel-telegram-log
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/muath-ye/laravel-telegram-log
- Owner: muath-ye
- License: mit
- Created: 2022-07-27T05:35:49.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2022-08-01T08:52:56.000Z (over 2 years ago)
- Last Synced: 2024-04-10T04:21:10.802Z (7 months ago)
- Language: PHP
- Size: 85.9 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![Laravel Telegram Log](./images/yos-laravel-telegram-log.svg)
![Packagist Downloads](https://img.shields.io/packagist/dt/Yemeni-Open-Source/laravel-telegram-log?color=blue&label=Downloads&logo=packagist&logoColor=white)
![Packagist Version](https://img.shields.io/packagist/v/Yemeni-Open-Source/laravel-telegram-log?color=green&label=Version&logo=laravel&logoColor=white)
![GitHub](https://img.shields.io/github/license/Yemeni-Open-Source/laravel-telegram-log?logo=Open%20Source%20Initiative&label=License&logoColor=white&color=blueviolet)# Laravel Telegram log
Laravel telegram log is a package that can catch your logs all quite simply.
## Requirments
This package is tested with Laravel v8 it my not work on Laravel v7 or v6 or v5
|||
|-|-|
|php| ^7.3|^8.0|
|Composer| ^2.3|
|Laravel| ^8.0|## Installation
Install the package by using composer:
> ```composer require yemeni-open-source/laravel-telegram-log```
## Configure Your Needs
You can scape this step if you want to use default configuration, but you can publish telegram logs configuration by running:
> ```php artisan vendor:publish --provider="YemeniOpenSource\TelegramLog\TelegramLogServiceProvider" --tag=config```
This will merge the ```config/telegramlog.php``` config file to your root ```config``` directory. You are free to modify it.
## Setup
### Create Telegram bot
Create new telegram bot as following steps:
- visit [@BotFather](https://telegram.me/BotFather)
- send ```/newbot``` to the [@BotFather](https://telegram.me/BotFather) chat.
- replay with the name of your new bot.
- then replay with the username for your bot.
- copy your bot **token**.### Open New Chat with your created bot
- visit [t.me/username_of_your_bot](http://t.me/username_of_your_bot)
- send ```Hi``` or any text message.
- visit [https://api.telegram.org/bot<**YourBOTToken**>/getUpdates](https://api.telegram.org/bot/getUpdates)
- copy your **```id```** which inside ```chat``` object.### Update your .env file
```env
LOG_CHANNEL=telegram
TELEGRAM_LOGGER_BOT_TOKEN=
TELEGRAM_LOGGER_CHAT_ID=
```### Add Telegram Log Channel
- Add the ```telegram``` logging channel to your ```config/logging.php```.
```php
'channels' => [
// ...
'telegram' => [
'driver' => 'custom',
'via' => YemeniOpenSource\TelegramLog\Services\TelegramService::class,
'level' => 'debug',
],
// ...
],
```## Credits
The MIT License (MIT). Please see [MIT license](LICENSE) File for more information.