prajwal89/laravel-share-to
最新稳定版本:v0.2.0
Composer 安装命令:
composer require prajwal89/laravel-share-to
包简介
Generate and render social share buttons without any hassle
README 文档
README
Generate and render social share buttons without any hassle
Live Preview https://laravel-share-to.prajwalhallale.com
Installation
composer require prajwal89/laravel-share-to
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
This step is not required on Laravel 5.5 and above
// config/app.php 'providers' => [ Prajwal89\LaravelShareTo\LaravelShareToServiceProvider::class, ];
Publish assets
php artisan vendor:publish --provider="Prajwal89\LaravelShareTo\LaravelShareToServiceProvider"
Run database migration
php artisan migrate
Usage
use Prajwal89\LaravelShareTo\Share; $options = [ 'tracking' => true, //this will keep track of share in track_shares table //options for container 'buttonGap' => 10, //in px 'alignment' => 'center', // accepts (start|center|end) alignment of of buttons in container //options for button 'borderWidth' => 2, 'radius' => 4, 'paddingX' => 4, 'paddingY' => 8, ]; $share = Share::Page('McqMate - MCQ Portal for Students', 'https://mcqmate.com', $options); echo $share->all()->getButtons();
Get all available buttons
echo $share->all()->getButtons();
Get single button
echo $share->facebook()->getButtons();
Get multiple buttons
echo $share->whatsapp()->twitter()->getButtons(); //or echo $share->only(['whatsapp','twitter'])->getButtons();
Get raw links
This will return array of share urls
you can use this to render buttons according to your need
echo $share->all()->getRawLinks(); //or echo $share->only(['whatsapp','twitter'])->getRawLinks();
License
laravel-share-to package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 225
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-02