PHPackages                             faribe/social-share - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. faribe/social-share

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

faribe/social-share
===================

Optional package for Laravel to generate social share links.

1.0.0(3y ago)26MITPHPPHP ^7.4|^8.0

Since Jun 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/faribe/social-share)[ Packagist](https://packagist.org/packages/faribe/social-share)[ RSS](/packages/faribe-social-share/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Social Share
============

[](#social-share)

[![Latest Version on Packagist](https://camo.githubusercontent.com/93febbc9cd50e865b63bffa18e18fb1004f862b58725a82160a7b89be6f84bd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661726962652f736f6369616c2d73686172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faribe/social-share)[![Total Downloads](https://camo.githubusercontent.com/5cb5f3d7e4c4bb0a946d453ab4a4be2066125bc1bbc53912f7086cbd969e0f46/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6661726962652f736f6369616c2d73686172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faribe/social-share)

Share links exist on almost every page in every project, creating the code for these share links over and over again can be a difficult at times. With Laravel Share you can generate these links in just seconds in a way tailored for Laravel.

### Available services

[](#available-services)

- Facebook
- Twitter
- Linkedin
- WhatsApp
- Reddit
- Telegram
- Viber

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require faribe/social-share
```

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
// config/app.php
'providers' => [
    Faribe\SocialShare\SocialShareServiceProvider::class,
];
```

And optionally add the facade in config/app.php

```
// config/app.php
'aliases' => [
    'SocialShare' => Faribe\SocialShare\SocialShareFacade::class,
];
```

Publish the package config &amp; resource files.

```
php artisan vendor:publish --provider="Faribe\SocialShare\SocialShareServiceProvider"
```

> You might need to republish the config file when updating to a newer version of Laravel Share

This will publish the `laravel-share.php` config file to your config folder, `share.js` in `public/js/` folder.

### Fontawesome

[](#fontawesome)

Since this package relies on Fontawesome, you will have to require it's css, js &amp; fonts in your app. You can do that by requesting a embed code [via their website](http://fontawesome.io/get-started/) or by installing it locally in your project.

Laravel share supports Font Awesome v5. For Font Awsome 4 support use version [3](https://github.com/jorenvh/laravel-share/tree/3.3.1) of this package.

### Javascript

[](#javascript)

Load jquery.min.js &amp; share.js by adding the following lines to your template files.

```

```

Usage
-----

[](#usage)

### Creating one share link

[](#creating-one-share-link)

#### Facebook

[](#facebook)

```
SocialShare::page('http://faribe.be')->facebook();
```

#### Twitter

[](#twitter)

```
SocialShare::page('http://faribe.be', 'Your share text can be placed here')->twitter();
```

#### Reddit

[](#reddit)

```
SocialShare::page('http://faribe.be', 'Your share text can be placed here')->reddit();
```

#### Linkedin

[](#linkedin)

```
SocialShare::page('http://faribe.be', 'Share title')->linkedin('Extra linkedin summary can be passed here')
```

#### Whatsapp

[](#whatsapp)

```
SocialShare::page('http://faribe.be')->whatsapp()
```

#### Telegram

[](#telegram)

```
SocialShare::page('http://faribe.be', 'Your share text can be placed here')->telegram();
```

#### Viber

[](#viber)

```
SocialShare::page('http://faribe.be', 'Your share text can be placed here')->viber();
```

### Sharing the current url

[](#sharing-the-current-url)

Instead of manually passing an url, you can opt to use the `currentPage` function.

```
SocialShare::currentPage()->facebook();
```

### Creating multiple share Links

[](#creating-multiple-share-links)

If want multiple share links for (multiple) providers you can just chain the methods like this.

```
SocialShare::page('http://faribe.be', 'Share title')
	->facebook()
	->twitter()
	->linkedin('Extra linkedin summary can be passed here')
    ->viber()
	->whatsapp();
```

This will generate the following html

```

```

### Getting the raw links

[](#getting-the-raw-links)

In some cases you may only need the raw links without any html, you can get these by calling the `getRawLinks` method.

**A single link**

```
SocialShare::page('http://faribe.be', 'Share title')
	->facebook()
	->getRawLinks();
```

Outputs:

```
https://www.facebook.com/sharer/sharer.php?u=http://faribe.be
```

**Multiple links**

```
SocialShare::page('http://faribe.be', 'Share title')
	->facebook()
	->twitter()
	->linkedin('Extra linkedin summary can be passed here')
	->whatsapp()
    ->getRawLinks();
```

Outputs:

```
[
  "facebook" => "https://www.facebook.com/sharer/sharer.php?u=http://faribe.be",
  "twitter" => "https://twitter.com/intent/tweet?text=Share+title&url=http://faribe.be",
  "linkedin" => "http://www.linkedin.com/shareArticle?mini=true&url=http://faribe.be&title=Share+title&summary=Extra+linkedin+summary+can+be+passed+here",
  "whatsapp" => "https://wa.me/?text=http://faribe.be",
]

```

### Optional parameters

[](#optional-parameters)

#### Add extra classes, id's or titles to the social buttons

[](#add-extra-classes-ids-or-titles-to-the-social-buttons)

You can simply add extra class(es), id('s), title(s) or relationship(s) by passing an array as the third parameter on the page method.

```
SocialShare::page('http://faribe.be', null, ['class' => 'my-class', 'id' => 'my-id', 'title' => 'my-title', 'rel' => 'nofollow noopener noreferrer'])
    ->facebook();
```

Which will result in the following html

```

```

#### Custom wrapping

[](#custom-wrapping)

By default social links will be wrapped in the following html

```

```

This can be customised by passing the prefix &amp; suffix as a parameter.

```
SocialShare::page('http://faribe.be', null, [], '', '')
            ->facebook();
```

This will output the following html.

```

```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Joren Van Hocht](https://github.com/jorenvh)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d635834bda65edd57ea49fde939cf078645f21c7ac5fb1c33280358ec9fe6a6a?d=identicon)[faribe](/maintainers/faribe)

---

Top Contributors

[![faribe](https://avatars.githubusercontent.com/u/32103549?v=4)](https://github.com/faribe "faribe (7 commits)")

---

Tags

laravelsharesocial linkssocial share links

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/faribe-social-share/health.svg)

```
[![Health](https://phpackages.com/badges/faribe-social-share/health.svg)](https://phpackages.com/packages/faribe-social-share)
```

###  Alternatives

[jorenvanhocht/laravel-share

Optional package for Laravel to generate social share links.

5341.1M5](/packages/jorenvanhocht-laravel-share)[chencha/share

Share links with Laravel

182272.6k](/packages/chencha-share)[kudashevs/laravel-share-buttons

A Laravel social media share buttons package.

4355.1k](/packages/kudashevs-laravel-share-buttons)[ryannielson/shareable

A Laravel 4 package to make it easy to add social sharing buttons to your application.

222.8k](/packages/ryannielson-shareable)[yaro/soc-share

Social network share link builder

101.9k](/packages/yaro-soc-share)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
