PHPackages                             yousefyahya/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. yousefyahya/share

ActiveLibrary

yousefyahya/share
=================

Share links with Laravel 5/6/7/8/9

6.0.0(4y ago)017MITPHPPHP &gt;=8.0.2

Since Feb 17Pushed 4y agoCompare

[ Source](https://github.com/yousefyahya/social-share)[ Packagist](https://packagist.org/packages/yousefyahya/share)[ RSS](/packages/yousefyahya-share/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (8)Used By (0)

Share
=====

[](#share)

Share links with Laravel 5/6/7/8/9

Services available
------------------

[](#services-available)

- Delicious : delicious
- Digg : digg
- Email : email
- Evernote : evernote
- Facebook : facebook
- Facebook Messenger : fbMessenger
- Gmail : gmail
- Google Plus : gplus
- LinkedIn : linkedin
- Pinterest : pinterest
- Reddit : reddit
- Scoop.it : scoopit
- Telegram.me : telegramMe
- Tumblr : tumblr
- Twitter : twitter
- Viadeo : viadeo
- vk.com : vk
- Whatsapp : whatsapp

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

[](#installation)

Step 1 : Install Composer dependency

```
composer require Yousefyahya/share

```

Step 2 : Register the Service Provider

Add *Yousefyahya\\Share\\ShareServiceProvider* to providers array in *config/app.php*

Step 3 : Register Alias

Add *Share* =&gt; *Yousefyahya\\Share\\ShareFacade* to aliases array in *config/app.php*

Usage
-----

[](#usage)

Get a link (example with Twitter)

```
Route::get('/', function()
{
	return Share::load('http://www.example.com', 'My example')->twitter();
});

```

Returns a string :

```
https://twitter.com/intent/tweet?url=http%3A%2F%2Fwww.example.com&text=Link+description

```

Get many links

```
Route::get('/', function()
{
	return Share::load('http://www.example.com', 'Link description')->services('facebook', 'gplus', 'twitter');
});

```

Returns an array :

```
{
    "gplus" : "https://plus.google.com/share?url=http%3A%2F%2Fwww.example.com",
    "twitter" : "https://twitter.com/intent/tweet?url=http%3A%2F%2Fwww.example.com&text=Link+description",
    "facebook" : "https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.example.com&title=Link+description"
}

```

Get ALL the links

```
Route::get('/', function()
{
	return Share::load('http://www.example.com', 'Link description')->services();
});

```

Returns an array of results for all defined services.

Customization
-------------

[](#customization)

Publish the package config:

```
php artisan vendor:publish --provider='Yousefyahya\Share\ShareServiceProvider'

```

Add a new service in config/social-share.php:

```
'mynewservice' => [ 'view' => 'share.mynewservice' ]

```

Add Blade templating code in *share.mynewservice* view file to generate a URL for *mynewservice*. You have access to:

- service - the service definition (shown above).
- sep - separator used between parameters, defaults to '&amp;'. Configurable as *social-share.separator*.
- url - the URL being shared.
- title - the title being shared.
- media - media link being shared.

Example:

```
https://mynewservice.example.com?url={{ rawurlencode($url) }}title={{ rawurlencode("Check this out! $title. See it here: $url") }}

```

Another example for the *email* service. Change the service config to be *\[ 'view' =&gt; 'whatever' \]* and put this in the view file:

```
mailto:?subject={{ rawurlencode("Wow, check this: $title") }}body={{ rawurlencode("Check this out! $title. See it here: $url") }}

```

Localizing? Easy, use Laravel's trans() call:

```
mailto:?subject={{ rawurlencode(trans('share.email-subject', compact('url', 'title', 'media'))) }}body={{ rawurlencode(trans('share.email-body', compact('url', 'title', 'media'))) }}

```

Create a file at resources/lang/en/share.php with your choice of subject and body. URLs arguably have a maximum length of 2000 characters.

Notice the use of . It's the only way to print out an unencoded ampersand (if configured that way).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 56.1% 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

Every ~427 days

Recently: every ~544 days

Total

7

Last Release

1536d ago

Major Versions

5.4.0 → 6.0.02022-02-23

PHP version history (4 changes)5PHP &gt;=5.3.0

5.1.0PHP &gt;=5.6.0

5.2.0PHP &gt;=5.4.0

6.0.0PHP &gt;=8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e074c1ff72c549667eee29f426f90d67769a1f0b4bc0e0ab43dcd3e3816540c3?d=identicon)[Yousef Yahya](/maintainers/Yousef%20Yahya)

---

Top Contributors

[![datashaman](https://avatars.githubusercontent.com/u/59514?v=4)](https://github.com/datashaman "datashaman (32 commits)")[![prodeveloper](https://avatars.githubusercontent.com/u/1224225?v=4)](https://github.com/prodeveloper "prodeveloper (11 commits)")[![yousefyahya](https://avatars.githubusercontent.com/u/23498701?v=4)](https://github.com/yousefyahya "yousefyahya (8 commits)")[![shanmuga3](https://avatars.githubusercontent.com/u/38732797?v=4)](https://github.com/shanmuga3 "shanmuga3 (2 commits)")[![ibrahim-mubarak](https://avatars.githubusercontent.com/u/47777720?v=4)](https://github.com/ibrahim-mubarak "ibrahim-mubarak (2 commits)")[![the94air](https://avatars.githubusercontent.com/u/18303390?v=4)](https://github.com/the94air "the94air (1 commits)")[![shaydy95](https://avatars.githubusercontent.com/u/24454741?v=4)](https://github.com/shaydy95 "shaydy95 (1 commits)")

---

Tags

laravellaravel5sharelaravel6laravel8laravel9laravel7

### Embed Badge

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

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

###  Alternatives

[onecentlin/laravel-adminer

Laravel Adminer Database Manager

260491.1k3](/packages/onecentlin-laravel-adminer)[salmanzafar/laravel-mqtt

A simple Laravel Library to connect/publish/subscribe to MQTT broker

106153.1k1](/packages/salmanzafar-laravel-mqtt)[salmanzafar/laravel-geo-fence

A Laravel Library to calculate distance between two longitude and latitudes

157.3k1](/packages/salmanzafar-laravel-geo-fence)[salmanzafar/laravel-geocode

A Laravel Library to find Lat and Long of a given Specific Address

153.9k](/packages/salmanzafar-laravel-geocode)

PHPackages © 2026

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