定制 zerkxubas/social-share-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

@zerkxubas

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-21