承接 yaro/soc-share 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

yaro/soc-share

最新稳定版本:1.0.4

Composer 安装命令:

composer require yaro/soc-share

包简介

Social network share link builder

README 文档

README

Link builder for social share button for Laravel 5.

Installation

Add dependency to composer.json:

"require": {
    "yaro/soc-share": "1.*"
}

Add to config/app.php:

'providers' => array(
//...
    Yaro\SocShare\ServiceProvider::class,
//...
),
'aliases' => array(
//...
    'SocShare' => Yaro\SocShare\Facade::class,
//...
),

Then run command:

$ php artisan vendor:publish --provider="Yaro\SocShare\ServiceProvider"

Usage

Currently supported networks: google+, facebook, twitter, vkontakte, pinterest, tumblr, odnoklassniki, linkedin.
Ex:

<a href="{{ SocShare::gplus()->getUrl() }}" target="_blank">Google+ ({{ SocShare::gplus()->getCount() }})</a>
<a href="{{ SocShare::pinterest(['media' => asset('/img/pin.png'), 'description' => 'oh hai'])->getUrl() }}" target="_blank">Pin it!</a>

To get share count call getCount() ia your network provider with the same parameters:

<a href="{{ SocShare::pinterest(['media' => asset('/img/pin.png'), 'description' => 'oh hai'])->getUrl() }}" target="_blank">
    Already {{ SocShare::pinterest(['media' => asset('/img/pin.png'), 'description' => 'oh hai'])->getCount() }}
</a>

Or go with js to open share dialog in new window:

{{ SocShare::renderJs() }}

<a onclick="{{ SocShare::vk()->getJs() }}" href="javascript:void(0);">Share me</a>

All parameteres listed in config file.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-18