zerkxubas/social-share-laravel
最新稳定版本:v1.0.1
Composer 安装命令:
composer require zerkxubas/social-share-laravel
包简介
A simple & effective laravel package for social link sharing
README 文档
README
This package is simple and effective for generating social share links without any complications in laravel projects.
Installation
composer require zerkxubas/social-share-laravel
Publishing The Configurations
php artisan vendor:publish --tag=socialshare
.env Settings [ For Messenger ]
inside the .env file use these below config values for fb app setup.
FACEBOOK_APP_ID=your-facebook-app-id
NOTE: if you are not using for platform messenger then no need to change your .env file.
Generating the url.
use Zerkxubas\SocialShareLaravel\SocialShare; SocialShare::generate($platform,$url); // OR, SocialShare::generate($platform,$url,$og_title,$og_description);
Thats it!😍
Note: This returns a single url for a platform. Kindly read the currently supported social platforms below.
Supported Social Platforms
Here are some of the currently supported platforms and more will be added in future.
- Facebook
facebook - Messenger
messenger - Twitter
twitter - Linkedin
linkedin - WhatsApp
whatsapp - Reddit
reddit
Example
use Zerkxubas\SocialShareLaravel\SocialShare; // Basic usage $facebookUrl = SocialShare::generate('facebook', 'https://localhost/blog/social-share-laravel'); // Or $facebookUrl = SocialShare::generate('facebook', route('blog.posts',$id)); // With Open Graph (og) title and description $twitterUrl = SocialShare::generate('twitter', 'https://example.com', 'Example Title', 'Example Description');
Note: Just try it. It really saves time.
License
- Open Source, free to use & distribute.
Author
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-21