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

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

laravel-social/share
====================

Share links with Laravel 5/6

1.0.0(6y ago)046MITPHPPHP &gt;=7.1.0

Since Nov 3Pushed 6y ago1 watchersCompare

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

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

Share
=====

[](#share)

Share links with Laravel 6

This is a fork to Jacob Chencha's share for Laravel 5/6.

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

[](#services-available)

- Email : email
- Evernote : evernote
- Facebook : facebook
- Gmail : gmail
- LinkedIn : linkedin
- Pinterest : pinterest
- Scoop.it : scoopit
- Telegram.me : telegramMe
- Tumblr : tumblr
- Twitter : twitter
- vk.com : vk

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

[](#installation)

Step 1 : Install Composer dependency

```
composer require laravel-social/share

```

Step 2 : Register the Service Provider

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

Step 3 : Register Alias

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

Usage
-----

[](#usage)

Import this pakage into controller as "use Share";

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='Chencha\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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

2383d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e687333dd17b16b0c8c72070dea3d0d412f38ae1dbdfd65cc4b3dc53940dbf6?d=identicon)[niridoy](/maintainers/niridoy)

---

Tags

laravellaravel5sharelaravel6

### Embed Badge

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

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

###  Alternatives

[brexis/laravel-workflow

Integerate Symfony Workflow component into Laravel.

283125.6k](/packages/brexis-laravel-workflow)[misterphilip/maintenance-mode

An enhanced drop-in replacement for Laravel's maintenance mode

120176.7k](/packages/misterphilip-maintenance-mode)[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)
