LaravelPackages.net
Acme Inc.
Toggle sidebar
mohamadmurad/laravel-telegram-reporter

Get Crud Report by telegram

19
0
v1.5
About mohamadmurad/laravel-telegram-reporter

mohamadmurad/laravel-telegram-reporter is a Laravel package for get crud report by telegram. It currently has 0 GitHub stars and 19 downloads on Packagist (latest version v1.5). Install it with composer require mohamadmurad/laravel-telegram-reporter. Discover more Laravel packages by mohamadmurad or browse all Laravel packages to compare alternatives.

Last updated

laravelTelegramReport

Easy Send Activity For Any Model To Your Telegram

Documentation

install the package via composer

composer require mohamadmurad/laravel-telegram-reporter

Config file

This package publishes a config/telegram-report.php file. If you already have a file by that name, you must rename or remove it, as it will conflict with this package. You could optionally merge your own values with those required by this package, as long as the keys that this package expects are present. See the source file for more details telegram-report.php

Publish the config/telegram-report.php config file with:

php artisan telegram-report:install

Add Configration data to your .env file see how to create bot

TELEGRAM_TOKEN="Token for your telegram bot"  
TELEGRAM_CHAT_ID ="your account id in telegram"

If you want to log CRUD on any model

Add package trait to any model you want to get report about it example :


use mohamadmurad\LaravelTelegramReport\Traits\HasTelegramReports;

class User extends Authenticatable
{
    use HasTelegramReports;
....

}

the report send after create , update or delete any record in this model

If you want to send Errors to your Telegram bot

Add this code to your Exception Handler.php



class Handler extends ExceptionHandler
{
     public function render($request, Throwable $e)
    {
        if (app()->bound('telegram-report')) {
            app('telegram-report')->notify($e, app('request'));
        }
        
        .... 
    }
....

}
Comments