Skip to content

sagautam5/social-share-count

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Share Count

This will help to count the social share count of a url

Latest Stable Version Total Downloads Issues Stars License Forks Twitter

Description

Social share count is the laravel package to determine number of times a url is shared on social media like facebook.

Social Share Count Requires

PHP >= 7.3.*

Laravel >= 7.0.*

Support

  • Facebook
  • Pinterest
  • Reddit

Installation

composer require sagautam5/social-share-count

Configuration

Facebook

At first, get App ID and App Secret by creating new app in https://developers.facebook.com. Get App ID and Secret

Now, add those credentials in .env file.

FB_APP_ID='xxxxxxxxxxxxxxxx'
FB_APP_SECRET='XXXXXXXXXXXXXXXXXXXXXXXXXX'

Now, Clear the configuration cache.

php artisan config:cache

Pinterest

Currently, you don't need any application id or secret to count pinterest shares. You can just call the function.

Reddit

Currently, you don't need any application id or secret to count reddit shares. You can just call the function.

Basic Usage

After installation, you can use the share count feature like this:

use Sagautam5\SocialShareCount\ShareCounter;

$url = 'https://www.example.com';

$facebookShares = ShareCounter::getFacebookShares($url);
echo $facebookShares;

$pinterestShares = ShareCounter::getPinterestShares($url);
echo $pinterestShares;

$redditShares = ShareCounter::getRedditShares($url);
echo $redditShares;

🤝 Contributing

Please see CONTRIBUTING for details.

📄 License

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