PHPackages                             gflaminio3/telara - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. gflaminio3/telara

ActiveLibrary[File &amp; Storage](/categories/file-storage)

gflaminio3/telara
=================

A custom Laravel package that provides a storage disk for uploading files to Telegram and retrieving them seamlessly

1.0.1(7mo ago)3160MITPHPPHP ^8.3.0CI failing

Since Oct 2Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/gflaminio3/telara)[ Packagist](https://packagist.org/packages/gflaminio3/telara)[ Fund](https://www.paypal.com/paypalme/enunomaduro)[ GitHub Sponsors](https://github.com/nunomaduro)[ RSS](/packages/gflaminio3-telara/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

Laravel Telegram Storage (Telara)
=================================

[](#laravel-telegram-storage-telara)

A custom Laravel package that provides a storage disk for uploading files to Telegram and retrieving them seamlessly. It integrates effortlessly with Laravel's Filesystem to let you store files through Telegram's API just like you would use S3, local, or any other disk.

**Features:**

- Automatic file chunking for large files (bypasses Telegram's 20MB limit)
- Optional AES-256 encryption for secure storage
- Multiple tracking drivers (database, JSON, array)
- Seamless Laravel Storage integration

 [![Laravel Telegram Storage](https://raw.githubusercontent.com/gflaminio3/telara/master/docs/banner.png)](https://raw.githubusercontent.com/gflaminio3/telara/master/docs/banner.png)
 [![Total Downloads](https://camo.githubusercontent.com/c595e0ad41cd0b73975b8cc997e68a70ff5011f95c52c1298eda137dceeddb59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67666c616d696e696f332f74656c617261)](https://packagist.org/packages/gflaminio3/telara) [![Latest Version](https://camo.githubusercontent.com/b92a4e4ab7fe7b0418c3a5d504b1e56f6ebfd7a89b3a012bdffb49a0b41b3787/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67666c616d696e696f332f74656c617261)](https://packagist.org/packages/gflaminio3/telara) [![License](https://camo.githubusercontent.com/04b2314f868c97517339c05e2f5427dea0d742307e09770a5a6581c1a5137f6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f67666c616d696e696f332f74656c617261)](https://packagist.org/packages/gflaminio3/telara)

---

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Chunking &amp; Encryption](#chunking--encryption)
- [Advanced Usage](#advanced-usage)
- [Testing](#testing)
- [License](#license)

---

Requirements
------------

[](#requirements)

- **PHP 8.3+**
- **Laravel 11+**
- A **Telegram bot token** from [BotFather](https://t.me/botfather)

Installation
------------

[](#installation)

```
composer require gflaminio3/telara
```

Publish configuration (optional):

```
php artisan vendor:publish --tag=telara-config
```

Run migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

### Interactive Setup

[](#interactive-setup)

```
php artisan telara:configure
```

This command will verify your bot token, fetch available chats, and update your `.env` automatically.

### Manual Setup

[](#manual-setup)

**1. Add disk in `config/filesystems.php`:**

```
'disks' => [
    'telegram' => [
        'driver' => 'telara',
        'bot_token' => env('TELEGRAM_BOT_TOKEN'),
        'chat_id' => env('TELEGRAM_CHAT_ID'),
    ],
],
```

**2. Configure `.env`:**

```
TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
TELEGRAM_CHAT_ID=987654321

TELARA_TRACK_FILES=true
TELARA_TRACKING_DRIVER=database

# Chunking (enabled by default)
TELARA_CHUNKING_ENABLED=true
TELARA_CHUNK_SIZE=19922944  # 19MB per chunk

# Encryption (disabled by default)
TELARA_ENCRYPTION_ENABLED=false

# Logging
TELARA_LOGGING_ENABLED=false
```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Storage;

// Upload a file
Storage::disk('telegram')->put('document.pdf', file_get_contents('path/to/file.pdf'));

// Upload with caption
Storage::disk('telegram')->put('image.jpg', $contents, ['caption' => 'My image']);

// Download a file
$contents = Storage::disk('telegram')->get('document.pdf');

// Check existence
if (Storage::disk('telegram')->exists('document.pdf')) {
    // File exists
}

// Delete from tracker
Storage::disk('telegram')->delete('document.pdf');
```

Chunking &amp; Encryption
-------------------------

[](#chunking--encryption)

### Automatic Chunking

[](#automatic-chunking)

Files larger than 19MB are automatically split into chunks and uploaded separately. They are reassembled transparently when downloaded.

```
// This file will be chunked automatically
$largeFile = str_repeat('A', 50 * 1024 * 1024); // 50MB
Storage::disk('telegram')->put('large.bin', $largeFile);

// Download - chunks are merged automatically
$retrieved = Storage::disk('telegram')->get('large.bin');
```

### Encryption

[](#encryption)

Enable encryption to secure your files with AES-256:

```
TELARA_ENCRYPTION_ENABLED=true
```

Files are encrypted before upload and decrypted on download automatically:

```
// Upload - encrypted automatically
Storage::disk('telegram')->put('secret.txt', 'Sensitive data');

// Download - decrypted automatically
$plaintext = Storage::disk('telegram')->get('secret.txt');
```

**Note:** Encryption works with both chunked and non-chunked files. Each chunk is encrypted individually.

### How It Works

[](#how-it-works)

- **Chunking**: Large files are split into 19MB chunks. Metadata tracks all chunk file\_ids for reassembly.
- **Encryption**: Uses AES-256-CBC with a random IV per file/chunk. Key is derived from `APP_KEY`.
- **Tracking**: Database stores chunked/encrypted flags for proper retrieval.

Advanced Usage
--------------

[](#advanced-usage)

### Database Tracking

[](#database-tracking)

Check tracked files:

```
$files = DB::table('telara_files')->get();

// Check if chunked/encrypted
$file = DB::table('telara_files')->where('path', 'large.bin')->first();
echo $file->is_chunked;    // true/false
echo $file->is_encrypted;  // true/false
```

### Disable Chunking

[](#disable-chunking)

To disable chunking (files &gt; 20MB will fail):

```
TELARA_CHUNKING_ENABLED=false
```

### Custom Chunk Size

[](#custom-chunk-size)

```
TELARA_CHUNK_SIZE=10485760  # 10MB chunks
```

### Channels

[](#channels)

To use a Telegram channel, add your bot as admin and use the channel ID:

```
TELEGRAM_CHAT_ID=-1001234567890
```

Testing
-------

[](#testing)

```
composer test
```

Individual commands:

```
composer lint          # Code style
composer test:types    # Static analysis
composer test:unit     # Unit tests
```

Limitations
-----------

[](#limitations)

- Telegram's download limit: 20MB per chunk (chunking bypasses upload limit)
- Files cannot be deleted from Telegram via API
- No directory structure support

Troubleshooting
---------------

[](#troubleshooting)

**Files upload but return false:**Enable logging to verify operations.

**Encryption not working:**Ensure `TELARA_ENCRYPTION_ENABLED=true` and run `php artisan config:clear`.

**Chunks not working:**Check logs with `TELARA_LOGGING_ENABLED=true` to see chunking operations.

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

---

**Enjoy building with Telara!**

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance68

Regular maintenance activity

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

219d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83f014854386a67fc1f0b7a42ddea2018f0c8189df44931f055243700c2b06c8?d=identicon)[gflaminio3](/maintainers/gflaminio3)

---

Top Contributors

[![gflaminio3](https://avatars.githubusercontent.com/u/114490362?v=4)](https://github.com/gflaminio3 "gflaminio3 (5 commits)")

---

Tags

phplaravelstoragetelegram

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gflaminio3-telara/health.svg)

```
[![Health](https://phpackages.com/badges/gflaminio3-telara/health.svg)](https://phpackages.com/packages/gflaminio3-telara)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[zing/laravel-flysystem-obs

Flysystem Adapter for OBS

1211.2k](/packages/zing-laravel-flysystem-obs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
