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

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

hebrahimzadeh/laravel-share
===========================

Share links with Laravel

v1.0.2(3y ago)023MITPHPPHP ^7.4 || ^8.0 || ^8.1

Since Oct 18Pushed 3y agoCompare

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

READMEChangelogDependencies (4)Versions (4)Used By (0)

Share
=====

[](#share)

**Share links with Laravel**

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

[](#services-available)

- Blogger : blogger
- Digg : digg
- Email : email
- Evernote : evernote
- Facebook : facebook
- Gmail : gmail
- LinkedIn : linkedin
- Pinterest : pinterest
- Reddit : reddit
- Scoop.it : scoopit
- Telegram.me : telegram
- Tumblr : tumblr
- Twitter : twitter
- vk.com : vk

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

[](#installation)

Install Composer dependency into your project

```
composer require hebrahimzadeh/laravel-share

```

Usage
-----

[](#usage)

Get a link (example with Twitter)

```
Route::get('/', function()
{
    return Share::page('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::page('http://www.example.com', 'Link description')->services('facebook', 'twitter')->getLinks();
});
```

Returns an array :

```
{
    "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::page('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='Hebrahimzadeh\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).

Upgrades
--------

[](#upgrades)

When the package is upgraded, changes to the config and views should be republished into your project:

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

```

Use source control to work out what has changed if you have customized the files.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.4% 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 ~1 days

Total

3

Last Release

1299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75c05a67e6f24580b5b5421cc09fef166a6d290ba79bb8efc8bbe78fd5cbe8f7?d=identicon)[hebrahimzadeh](/maintainers/hebrahimzadeh)

---

Top Contributors

[![datashaman](https://avatars.githubusercontent.com/u/59514?v=4)](https://github.com/datashaman "datashaman (68 commits)")[![Hebrahimzadeh](https://avatars.githubusercontent.com/u/38420287?v=4)](https://github.com/Hebrahimzadeh "Hebrahimzadeh (12 commits)")[![prodeveloper](https://avatars.githubusercontent.com/u/1224225?v=4)](https://github.com/prodeveloper "prodeveloper (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 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)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![thegr8dev](https://avatars.githubusercontent.com/u/33778557?v=4)](https://github.com/thegr8dev "thegr8dev (1 commits)")[![shaydy95](https://avatars.githubusercontent.com/u/24454741?v=4)](https://github.com/shaydy95 "shaydy95 (1 commits)")[![the94air](https://avatars.githubusercontent.com/u/18303390?v=4)](https://github.com/the94air "the94air (1 commits)")[![DaiSuanMung](https://avatars.githubusercontent.com/u/54679650?v=4)](https://github.com/DaiSuanMung "DaiSuanMung (1 commits)")

---

Tags

laravelshare

###  Code Quality

Static AnalysisRector

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[chencha/share

Share links with Laravel

182272.6k](/packages/chencha-share)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[ryannielson/shareable

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

222.8k](/packages/ryannielson-shareable)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[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)
