Skip to content

Instantly share code, notes, and snippets.

Route::get('/bot', function (\Telegram\Bot\Api $telegram) {
$facade = Telegram::getAccessToken();
echo "Facade says: $facade <br />";
$di = $telegram->getAccessToken();
echo "DI says says: $di <br />";
$tg = app('\Telegram\Bot\Api');
$make = $tg->getAccessToken();
echo "App make says: $make <br />";
<?php
namespace Telegram\Bot\Laravel;
use Telegram\Bot\Api;
use Illuminate\Support\ServiceProvider;
/**
* Class TelegramServiceProvider
*
<?php
use ZipStream\ZipStream;
Route::get('/test', function () {
$tempStream = fopen('php://temp', 'w+');
$zipStream = new ZipStream(null, [ZipStream::OPTION_OUTPUT_STREAM => $tempStream]);
$zipStream->addFile('MyTextFile.txt', 'This is the contents.');
$zipStream->finish();
rewind($tempStream);
@jonnywilliamson
jonnywilliamson / HandleNutgramWebhookFailure.php
Created May 17, 2026 22:42
Laravel Nutgram multi-bot reference implementation
<?php
namespace App\Telegram\Support;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Throwable;
class HandleNutgramWebhookFailure