putheakhem/laravel-social-stats

Fetch follower/subscriber stats from various social media platforms.

Installs: 321

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/putheakhem/laravel-social-stats

v1.1.3 2025-04-04 04:30 UTC

This package is auto-updated.

Last update: 2026-01-28 04:56:23 UTC


README

Latest Version Total Downloads License

A Laravel package to fetch follower/subscriber counts from various social media platforms including Telegram, YouTube, and Facebook Pages.

🇰🇭 Stand with Cambodia • កម្ពុជា

🕊️ Cambodia Needs Peace 🕊️

With heavy hearts, we stand with our brave soldiers defending Cambodia’s land and dignity.
We seek no conflict—only peace, justice, and respect for our sovereignty.

🙏 កម្ពុជាត្រូវការសន្តិភាព • Together to protect Cambodia’s sovereignty.

✨ Features

  • 📊 Get real-time follower counts from:
    • Telegram Channels
    • YouTube Channels
    • Facebook Pages
    • Instagram Followers (via connected Facebook Page)
    • TikTok Followers
  • ⚡ Built Support Laravel 11+ & PHP 8.2+
  • 🔒 Caching with Laravel’s new Cache::flexible()
  • 🧹 Facade support: SocialStats::platform('telegram')

📦 Installation

composer require putheakhem/laravel-social-stats

Ensure you’ve configured your Laravel app to support package discovery.

⚙️ Configuration

Publish the config file:

php artisan vendor:publish --tag=config

Set the following in .env:

YOUTUBE_API_KEY=your_youtube_api_key
FACEBOOK_ACCESS_TOKEN=your_facebook_access_token
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
INSTAGRAM_ACCESS_TOKEN=your_instagram_access_token
INSTAGRAM_PAGE_ID=your_instagram_business_account_id

🔧 Usage

use SocialStats;

// Telegram
SocialStats::platform('telegram')->fetchCount('your_channel_username'); // No @ symbol

// YouTube
SocialStats::platform('youtube')->fetchCount('UCxxxxxxx'); // Channel ID

// Facebook Page
SocialStats::platform('facebook')->fetchCount('your_page_id'); // Page ID Number (3127652********)

// Instagram (uses page_id to discover linked Instagram account)
SocialStats::platform('instagram')->fetchCount('fintechcenterfsa'); // Instagram username

// TikTok
SocialStats::platform('tiktok')->fetchCount('your_tiktok_username'); // TikTok username

The package uses Laravel’s built-in HTTP and cache systems.

✅ Supported Platforms

  • ✅ Telegram Channels Subscribers
  • ✅ YouTube Channels Subscribers
  • ✅ Facebook Page Likes
  • ✅ Instagram Followers (via connected Facebook Page)
  • ✅ TikTok Follower
  • ⏳ Twitter Follower (planned)

🔪 Testing

To run tests:

composer test

Support Me

If you find this package useful, consider supporting my work:

📄 License

The MIT License (MIT). Please see License File for more information.

💡 Contributing

Feel free to submit PRs or open issues for suggestions and improvements.